Skip to content

Commit

Permalink
Merge pull request #11 from MyParcelCOM/bugfix/invalid-headers
Browse files Browse the repository at this point in the history
πŸ› Add jsonapi accept header when posting resources
  • Loading branch information
M4tini authored Dec 1, 2017
2 parents b40e273 + f47b3fe commit d5de2bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/MyParcelComApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,9 @@ protected function postResource(ResourceInterface $resource)
'post',
$this->getResourceUri($resource->getType()),
[
RequestOptions::HEADERS => $this->authenticator->getAuthorizationHeader(),
RequestOptions::HEADERS => $this->authenticator->getAuthorizationHeader() + [
AuthenticatorInterface::HEADER_ACCEPT => AuthenticatorInterface::MIME_TYPE_JSONAPI,
],
RequestOptions::JSON => ['data' => $resource],
]
)->then(function (ResponseInterface $response) {
Expand Down

0 comments on commit d5de2bc

Please sign in to comment.