What is the HTTP “content-type” to use for a blob of bytes?

后端 未结 2 1105
失恋的感觉
失恋的感觉 2021-01-03 17:52

What is the HTTP \"content-type\" to use when returning a blob of bytes in response to a client\'s GET request?

In this case, the information payload is an object se

相关标签:
2条回答
  • 2021-01-03 18:02

    You should use application/octet-stream.

    0 讨论(0)
  • 2021-01-03 18:07

    You should use the proper MIME type:

    application/python-pickle
    

    This is the de-facto standard (this mean: it is not application/pickle or application/pickle-python).

    RFC2046 states:

    4.5.3. Other Application Subtypes It is expected that many other subtypes of "application" will be defined in the future. MIME implementations must at a minimum treat any unrecognized subtypes as being equivalent to "application/octet- stream".

    So, to a non-pickle-aware system, the stream will look like any other octet-stream (you are not doing anything which will break existing apps), but to a pickle-aware system this is vital information.

    0 讨论(0)
提交回复
热议问题