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

"Content-Type" header with GET request #43

Open
domkck opened this issue Nov 28, 2012 · 2 comments
Open

"Content-Type" header with GET request #43

domkck opened this issue Nov 28, 2012 · 2 comments

Comments

@domkck
Copy link

domkck commented Nov 28, 2012

Leaving the "Content-Type" header set for all requests (including GET which does not have any body) seems to confuse the Express.js router and a simple GET to /resource after a POST to /resource with 'Content-Type': 'application/json' returns 400.

Would it be right to remove the header for GET requests? If so I'll make a pull request.

@guyburton
Copy link

I find this to be quite annoying as well, would appreciate not having to unset the header.

@ameypotnis
Copy link

I got the same error code 400 and after adding ".removeHeader('Content-Type', 'application/json')" before calling get worked well with me.
more info about removeHeader is available at http://flatiron.github.io/api-easy/#section-8

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

No branches or pull requests

3 participants