User Tools

Site Tools


libraries:restwebservice:restrequestclass:getheader

RestRequest::getHeader()


Definition

Returns the submitted HTTP header of the request as an associative array.

Array getHeader ( )

Returns

  • Array
    Submittet HTTP header of the request as an associative array!

Example

$Request = new RestRequest();
 
// Called endpoint is: [PUT] https://www.domain.com/webservice/accounting/booking?debug=true
// Content is:         "id:5,account:1234,name:Mr. Smith,amount:592.30"
 
$Application = $Request->getApplication(); // "accounting"
$Method      = $Request->getMethod();      // "booking"
 
$HTTPHeader  = $Request->getHeader();      // array( "Content-Type" => "... )
 
$HeaderContenttype = $HTTPHeader['Content-Type'];       // "application/x-www-form-urlencoded"
$HeaderLanguage    = $HTTPHeader['Accepted-Language'];  // "en-US"
libraries/restwebservice/restrequestclass/getheader.txt · Last modified: 2022/12/22 14:06 by michael.pohl