Skip to content

Commit

Permalink
🐛 Add jsonapi accept header when posting resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Shady Khattab committed Dec 1, 2017
1 parent b40e273 commit f47b3fe
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 f47b3fe

Please sign in to comment.