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 negotiation - synchronisation of content type #53

Open
pawel-kow opened this issue Jan 26, 2024 · 0 comments
Open

Content negotiation - synchronisation of content type #53

pawel-kow opened this issue Jan 26, 2024 · 0 comments

Comments

@pawel-kow
Copy link

Why is this needed

The client MUST synchronize the value for the Content-Type and Accept headers, for example a client MUST NOT send an XML formatted request message to the server, while at the same time requesting a JSON formatted response message. The server MUST use the Content-Type HTTP header to indicate the media type used for the representation in the response message body. The server MUST return HTTP status code 406 (Not Acceptable) or 415 (Unsupported Media Type) when the client requests an unsupported media type.

Aren't the existing content negotiation methods in HTTP enough? In case of mixed support for request and response manifested by different Content-Type and Accept headers the server may decide based on it's own implementation if such request can be processed, or not and return 406 or 415 accordingly.
More important would be to make a clear indication, that in case of 406 or 415 response the whole request needs to be rejected and MUST not be processed by the server.

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

1 participant