RestApiClient: use Accept header for non-raw requests

This commit is contained in:
Thomas Gelf 2015-11-06 09:31:40 +01:00
parent 67551e6285
commit a74381ebc9

View File

@ -50,6 +50,11 @@ class RestApiClient
'Authorization: Basic ' . $auth,
'Connection: close'
);
if (! $raw) {
$headers[] = 'Accept: application/json';
}
if ($body !== null) {
$body = json_encode($body);
$headers[] = 'Content-Type: application/json';