base64 - Is Content-Transfer-Encoding an HTTP header? -
I am writing a web service that provides a base 64-encoded PDF file, so my plan Feedback:
Content Type: Application / PDF Content-Transfer-Encoding: Base64 My question is: What is the Content-Transfer-Encoding Is a valid HTTP header? I think it may only be for MIME if not, so how should my HTTP response be represented to represent this fact that I am returning a Base 64-encoded PDF? Thank you. Edit: It seems that HTTP does not support this header. From:
Note: While the definition of content- MD5 is exactly the same, for RIM 1864 in RFC 1864 for MIMIT unit-bodies, there are several ways in the content-MD5 to the HTT institution-bodies MIMIT is different for unit-bodies from its application. One is that HTTP does not use content-transfer-encoding, contrary to mime , and uses transfer encoding and content-encoding. Should I set my header? Thank you.
Edit Many code samples found in the comments of this PHP context manual page assume that it is actually is < / Em> According to a valid HTTP header:
(by obsolete) :
A content-transfer-encoding header field, which can be used to specify helpful encoding that was applied to data so that it was sent to mail Can pass through the bearing system data or character set limitations.
and later:
Many content-types that can be accessed via useful email, their "natural" format, 8-bit As the character or binary data Such data can not be transmitted on some transport protocols. For example, RFC 821 binds mail-messages to 7-bit US-ASCII data with 1000-bit lines.
Therefore, it is necessary to define a standard mechanism for re-encoding such data in 7-bit. Short-line format (...) use the content-transfer-encoding field to transproper type Is used to represent which is used to represent the body in an acceptable manner for transportation.
is a webservice, which is not identical with the email, you should not use this header.
You can use the Content-Encoding header which indicates that the transferred data has been compressed (Gzip value).
Content-Length can set the header, but in my opinion, if you are building webservice (this is not a HTTP server / proxy server) Content-type is enough please pay attention Keep in mind that if some specific headers (such as transfer-encoding ) do not use properly, then there are unexpected communications issues So, if you are not 100% sure to use some headers - if you really need it or not - just do not use it.
Comments
Post a Comment