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

Server can choose the media type on Accept fail #227

Merged
merged 3 commits into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions spec/GraphQLOverHTTP.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,15 @@ In alignment with the
specification, when a client does not include at least one supported media type
in the `Accept` HTTP header, the server MUST either:

1. Disregard the `Accept` header and respond with the default media type of
`application/json`, specifying this in the `Content-Type` header; OR
2. Respond with a `406 Not Acceptable` status code and stop processing the
request.
1. Respond with a `406 Not Acceptable` status code and stop processing the
request (RECOMMENDED); OR
2. Disregard the `Accept` header and respond with the server's choice of media
type (NOT RECOMMENDED).

Note: It is unlikely that a client can process a response that does not match
one of the media types it has requested, hence `406 Not Acceptable` being the
recommended response. However, the server authors may know better about the
specific clients consuming their endpoint, thus both approaches are permitted.

A server MUST support any _GraphQL-over-HTTP request_ which accepts the
`application/json` media type (as indicated by the `Accept` header).
Expand Down