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

how do you override Content-Type / Accept headers? #13

Closed
tuxpowered opened this issue Mar 21, 2017 · 3 comments · May be fixed by #171
Closed

how do you override Content-Type / Accept headers? #13

tuxpowered opened this issue Mar 21, 2017 · 3 comments · May be fixed by #171

Comments

@tuxpowered
Copy link

I am trying to write an API receiver, where I can not control the other end. The other end only allows headers 'Accept: application/json' and 'Content-Type: application/json'

What is the fastest way to accept and return application/json in the headers?

@firdaus-aziz
Copy link

I'm having the same problem. I think this is where the checking is done https://github.com/miLibris/flask-rest-jsonapi/blob/master/flask_rest_jsonapi/decorators.py

Not sure how to proceed from here.

@tuxpowered
Copy link
Author

@akira-dev
Copy link
Collaborator

The content-type and accept headers are related to the jsonapi 1.0 specification so i have not planned to make it configurable but you can try to override it via decorators

Natureshadow added a commit to Natureshadow/flask-rest-jsonapi that referenced this issue Jun 14, 2017
JSONAPI 1.0 specification says:

“Clients that include the JSON API media type in their Accept header MUST specify the media type there at least once without any media type parameters.”

That means, that there may be other acceptable MIME types, which the string comparison that was in place before prevented.

This should also help with issue miLibris#13.
This was referenced Sep 13, 2019
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

Successfully merging a pull request may close this issue.

3 participants