Giter Site home page Giter Site logo

Comments (2)

bbarry avatar bbarry commented on May 3, 2024

https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1

If no Accept header field is present, then it is assumed that the client accepts all media types. If an Accept header field is present, and if the server cannot send a response which is acceptable according to the combined Accept field value, then the server SHOULD send a 406 (not acceptable) response.

from api-guidelines.

decoderwheel avatar decoderwheel commented on May 3, 2024

@bbarry Yes, that's what I said. However, the REST guidelines say (my emphasis):

Per the HTTP guidelines, this is just a hint and responses MAY have a different content type,
such as a blob fetch where a successful response will just be the blob stream as the payload.

However, I've just answered my own question; RFC2616 was obsoleted by RFC 7231 (amongst others), which now says this in Section 5.3.2:

If the header field is present in a request and none of the available representations for the
response have a media type that is listed as acceptable, the origin server can either honor the
header field by sending a 406 (Not Acceptable) response or disregard the header field by
treating the response as if it is not subject to content negotiation.

I'd argue that's bad practice, but it is part of the spec.

from api-guidelines.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.