User Tools

Site Tools


libraries:restwebservice:restrequestclass:getheadervalue

RestRequest::getHeaderValue()


Definition

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

String getHeaderValue ( $Key )

Parameters

  • $Key String
    Name of the header field, which's value should be returned. The key search id done case insensitively.

Returns

  • String
    Value of the element with the given key or '', if no entry with this key could be found.

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"
libraries/restwebservice/restrequestclass/getheadervalue.txt · Last modified: 2022/12/22 21:00 by michael.pohl