-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP requests have the wrong Content-Type header #164
Comments
I have a similar problem when accessing an endpoint implemented in another language where the developer had to roll their own implementation, and made some mistakes. I need to add a media header to all GET requests, and the content type has to be the standard media type for JSON API. But I can't find where I make the change. I suspect it's in the middleware. |
@JohnSmall You are correct in your assumption that it requires you to add it in the middleware.
As per the example in the README |
Thanks for the advice Any idea how I would modify the middleware to deal with SSL client certificates? |
Hello,
I have noticed that
JsonApiClient::Resource
sends HTTP requests with a "Content-Type: application/json" header. Here is what needs fixing:Requests that have a non-empty body (i.e. POST, PUT and PATCH requests) must have a "Content-Type: application/vnd.api+json" header.
Requests without a body (i.e. GET and DELETE requests) do not need a Content-Type header.
This is a library that I plan on using in production if I can, so congrats.
The text was updated successfully, but these errors were encountered: