-
Notifications
You must be signed in to change notification settings - Fork 137
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
Transit is not the default format in the Accept header #130
Labels
Comments
I think it would probably be worth doing that re-ordering, since it'll help things like yada and liberator make the correct decision. Want to send a PR? |
Sure thing. I'll brew one up when I get a chance. |
I've been digging on this a little...think I can shed light on a few things.
I'll whip up a pull request to change the format order and see if I can improve the docs a little. |
camdez
added a commit
that referenced
this issue
Jun 8, 2016
Clarify effects of `:format` and `:response-format` params, prefer Transmit format
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The README says that the default request and response format is Transit, presumably
"application/transit+json"
. However, when I send a request with no format or content-type information, the "Accept" header has"application/json"
before"application/transit+json"
. The README says that the response format is derived from the "Content-Type" header, but specifying a content type for the request did not make a difference.The "Accept" header in the request is "Accept:application/json; charset=utf-8, application/transit+json; charset=utf-8, application/transit+transit; charset=utf-8, text/plain; charset=utf-8, text/html; charset=utf-8, /; charset=utf-8". At least according to the Chrome devtools network tab!
Although the "Content-Type" header was present in the request, the "Accepts" header did not change.
This version produced this "Accept" header: "Accept:application/transit+json; charset=utf-8".
I'm totally fine with just specifying a response format, but this behavior does seem to deviate from the documentation.
If this is actually an issue, fixing it may be as simple as reordering
ajax.core/default-formats
to put "application/transit+json" first.The text was updated successfully, but these errors were encountered: