You are here

protected property RestExampleClientCalls::$clientHeaders in Examples for Developers 3.x

The header uses when sending HTTP request.

The headers are very important when communicating with the REST server. It's used by the server the verify that it supports the sent data (Content-Type) and that it supports the type of response that the client wants.

Type: array

File

modules/rest_example/src/RestExampleClientCalls.php, line 35

Class

RestExampleClientCalls
Here we interact with the remote service.

Namespace

Drupal\rest_example

Code

protected $clientHeaders = [
  'Accept' => 'application/haljson',
  'Content-Type' => 'application/haljson',
];