HTTP content encoding, base64

前端 未结 1 742
孤城傲影
孤城傲影 2020-12-20 16:17

Is there any way to know if the message body of an HTTP response is encoded with Base64?

I learnt that content-transfer-encoding is not part of HTTP header.

相关标签:
1条回答
  • 2020-12-20 17:10

    As far as I understand, an HTTP body may not be encoded in Base64:

    HTTP does not use the Content-Transfer-Encoding (CTE) field of RFC 2045. Proxies and gateways from MIME-compliant protocols to HTTP MUST remove any non-identity CTE ("quoted-printable" or "base64") encoding prior to delivering the response message to an HTTP client.

    Identity being:

    The default (identity) encoding; the use of no transformation whatsoever.

    Of course you're allowed to transport Base64-encoded data using HTTP, but that should be something both parties (client and server) agree on, and there doesn't seem to be a header to describe this behavior.

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