Property | Type | Description | |
---|---|---|---|
$debug | |||
$format | |||
$parameters | |||
$request_uri | |||
$url_elements | |||
$verb |
Method | Description | |
---|---|---|
call ( ) : json | parse url and http body to retrieve : - HTTP VERB (GET/POST/DELETE/PUT) - Resource : Rest endpoint - Identifier - and parameters | |
getTypeName ( $nb ) | ||
inlineDocumentation ( $file = "apirest.md" ) | Display the APIRest Documentation in Html (parsed from markdown) | |
parseIncomingParams ( boolean $is_inline_doc = false ) | Construct this->parameters from query string and http body | |
returnResponse ( $response, $httpcode = 200, $aditionnalheaders = [] ) | Generic function to send a message and an http code to client |
Method | Description | |
---|---|---|
getId ( ) : integer | Retrieve in url_element the current id. If we have a multiple id (ex /Ticket/1/TicketFollwup/2), it always find the second | |
getItemtype ( $index, $recursive = true, $all_assets = false ) : boolean | Retrieve and check itemtype from $this->url_elements |
public call ( ) : json | ||
return | json | with response or error |
public inlineDocumentation ( $file = "apirest.md" ) | ||
$file | string relative path of documentation file (default 'apirest.md') |
public parseIncomingParams ( boolean $is_inline_doc = false ) | ||
$is_inline_doc | boolean | Is the current request asks to display inline documentation ? This will remove the default behavior who set content-type to application/json |
public returnResponse ( $response, $httpcode = 200, $aditionnalheaders = [] ) | ||
$response | string message or array of data to send | |
$httpcode | integer http code (default 200) (see: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) | |
$aditionnalheaders | array headers to send with http response (must be an array(key => value)) |