User Tools

Site Tools


libraries:restwebservice:restrequestclass:getunnamedparameters

RestRequest::getUnnamedParameters()


Definition

Returns the unnamed parameters of the current request as array.
Unnamed parameters are URL value parameters without key/name sent by the client divided by '/' in the URL.

Array getUnnamedParameters ( )

Returns

  • Array
    0-based indexed array with all parameter values sent by the client via URL ('/'-divided following the method name).

Example

$Request = new RestRequest();
 
// Called endpoint is: [PUT] https://www.domain.com/webservice/accounting/booking/draft
// Content is:         "id:5,account:1234,name:Mr. Smith,amount:592.30"
 
$Application = $Request->getApplication(); // "accounting"
$Method      = $Request->getMethod();      // "booking"
 
if ( $Request->hasUnnamedParameters() ) // true
{
   if ( $Request->getUnnamedParameters[0] == 'draft' )
   {
      [...]
   }
}
libraries/restwebservice/restrequestclass/getunnamedparameters.txt · Last modified: 2022/12/21 20:15 by michael.pohl