Giter Site home page Giter Site logo

Comments (3)

asyncee avatar asyncee commented on July 24, 2024

Hi!

The W3C Protocols page states:

Now that both HTTP extensions and HTTP/1.1 are stable specifications (RFC2616 at that time), W3C has closed the HTTP Activity.

So I assume that RFC2616 takes preference over RFC1341.

RFC2616 states that default media type should be application/octet-stream

Any HTTP/1.1 message containing an entity-body SHOULD include a
Content-Type header field defining the media type of that body. If
and only if the media type is not given by a Content-Type field, the
recipient MAY attempt to guess the media type via inspection of its
content and/or the name extension(s) of the URI used to identify the
resource. If the media type remains unknown, the recipient SHOULD
treat it as type "application/octet-stream".

What do you think?

from swagger_codegen.

asyncee avatar asyncee commented on July 24, 2024

Also, aiohttp client uses RFC2616 to set default content type if it is not specified so i think it's best to provide same behaviour between clients.

from swagger_codegen.

coderfromhere avatar coderfromhere commented on July 24, 2024

Sure, my only goal regarding this issue is to make tracebacks clearer than just KeyError, the actual implementation of a safer alternative to content_type=response.headers["Content-Type"] can be borrowed from either spec/library.

from swagger_codegen.

Related Issues (19)

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.