Skip to content
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

Default headers for XHR #18

Open
dhritzkiv opened this issue Sep 14, 2014 · 3 comments
Open

Default headers for XHR #18

dhritzkiv opened this issue Sep 14, 2014 · 3 comments
Labels

Comments

@dhritzkiv
Copy link
Member

Perhaps the default headers passed to XHR should be

{
    "Accept": "application/json"
}

I think it makes sense since the model is expecting JSON. I've been otherwise having to add this to ajaxConfig for all my models.

Thoughts?

@mikehedman
Copy link

@dhritzkiv - making the change you identify fixed my problem of receiving xml responses. It seems that the default Accept header is "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8", which I think is just the default that node's http module uses.
I'd vote for setting Ampersand's default to json.

@mikehedman
Copy link

I've submitted a pull request to ampersand-sync to implement this suggestion:
AmpersandJS/ampersand-sync#24

@pgilad
Copy link
Member

pgilad commented Aug 26, 2015

Hey @mikehedman I think this will be fixed with new &-sync version. Can you verify?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants