Guidance about `Accept` header for servers
See original GitHub issueThe protocol test RestJsonNoInputAllowsAccept caught my eye.
- Where in the Smithy spec is it specified how servers should handle this header?
- Should restJson1 servers reject requests if they don’t have
Content-Typeset and theAcceptheader is not set to any of these values? - Should servers accept requests that don’t specify
Content-TypenorAccept, but whose body is empty?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Accept - HTTP - MDN Web Docs
The Accept request HTTP header indicates which content types, expressed as MIME types, the client is able to understand. The server uses ...
Read more >HTTP/1.1: Header Field Definitions
The Accept request-header field can be used to specify certain media types which are acceptable for the response. Accept headers can be used...
Read more >HTTP headers | Accept - GeeksforGeeks
The Accept header is used to inform the server by the client that which content type is understandable by the client expressed as...
Read more >Accept-Ranges - HTTP: The Definitive Guide [Book] - O'Reilly
Name Accept-Ranges Synopsis The Accept-Ranges header differs from the other Accept headers—it is a response header used by servers to tell clients whether ......
Read more >Accept Header Field - Software AG Documentation
The Accept header field specifies which content type or types the client will accept in the response. The Accept header field can specify...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@adamthom-amzn Sounds good. That is in fact the same S3-like use case that a user of our sSDK wants to build: https://github.com/awslabs/smithy-rs/pull/1023#discussion_r777568429
But they’re using restXml, which currently also says that
Content-TypeMUST beapplication/octet-streamin the case of blob. Shall we change that too?I’m proposing we change the spec for
blobto say theContent-Typecan be anything, and handling of the content is delegated to the server implementation. Does this work for you?My mental model is this: if I wanted to have a REST API for a content repository that could receive images or videos of many different formats,
Content-Typeis the natural way to convey that.application/octet-streamdiscards important data in this use-case, andblobwould be the appropriate member choice.