RestRequest::getHeaderValue()


Definition

Returns the value of the given header field, transmitted with the client's request.

String getHeaderValue ( $Key )

Parameters

Returns

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"
 
$HTTPContenttype = $Request->getHeaderValue('Content-Type');       // "application/x-www-form-urlencoded"
$HTTPLanguage    = $Request->getHeaderValue('Accepted-Language');  // "en-US"