RestExampleClientCalls::$clientHeaders

The headers used when sending HTTP request.

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

Type: array

File

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

Class

RestExampleClientCalls
Here we interact with the remote service.

Namespace

Drupal\rest_example

Code

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