RestExampleClientCalls::$clientHeaders

Same name in other branches
  1. 3.x modules/rest_example/src/RestExampleClientCalls.php \Drupal\rest_example\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 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',
];