User Tools

Site Tools


libraries:restwebservice:restrequestclass:getmethod

RestRequest::getMethod()


Definition

Returns the method of the applcation to execute requested by the client.
Important! In the main.php of your created application/function collection you have to create a method with the following pattern to put functionallity to your method endpoint:
<REST verb>_<method name from URL>.

String getMethod ( )

Returns

  • String
    Method name of the called endpoint send by the requesting client (always lower case).

Example

$Request = new RestRequest();
 
// Called endpoint is: [PUT] https://www.domain.com/webservice/accounting/booking
// Content is:         "id:5,account:1234,name:Mr. Smith,amount:592.30"
 
$CalledMethod = $Request->getMethod();  // "booking"
 
// e.g. If you created a function put_booking() in the main.php file of your 
//      application/function collection, it is automatically executet by the
//      'ApplicationLauncher'
libraries/restwebservice/restrequestclass/getmethod.txt · Last modified: 2022/12/21 19:54 by michael.pohl