Clarify the utility of base64-encoding of whole payloads or multipart parts #3175
Labels
clarification
requests to clarify, but not change, part of the spec
media and encoding
Issues regarding media type support and how to encode data (outside of query/path params)
Milestone
As seen in recent PR comments with @ralfhandl and @baywet, and in an earlier thread I started on the HTTP APIs Slack, base64-encoding an entire payload, or an entire part in a
multipart
payload, doesn't make much sense in HTTP.Encoding binary to text as standardized in RFC 2045 Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies and revised and expanded in RFC 4648 The Base16, Base32, and Base64 Data Encodings was designed for email systems that often restricted bodies to 7-bit ASCII data. One of RFC 4648's revisions was to remove the line length restrictions on encoded data in RFC 2045, but the RFC still targeted environments with a 7-bit ASCII limitation. The MIME
Content-Transfer-Encoding
header indicated the use of such encoding.HTTP does not have a 7-bit ASCII limitation on message bodies. Encoding binary data into ASCII expands it by 33% to 300% (although compressing the result complicates the calcuations).
In 2015, RFC 7578 Returning Values from Forms:
multipart/form-data
replaced RFC 2388 and deprecated theContent-Transfer-Encoding
header in HTTP usage as it is not needed and no active use of it had been seen in the wild. It is still allowed in MIME.I would suggest that we do the following in 3.0.4 and 3.1.1:
Content-Transfer-Encoding
inmultipart/form-data
and note that attempting to use an Encoding Object to induce it is unlikely to be supported by relevant softwaremultipart
media types have not deprecatedContent-Transfer-Encoding
, but it is still unnecessary in the context of HTTPI'm guessing this probably needs some sort of @OAI/tsc approval.
Somewhat related: #1544 notes that
format: binary
doesn't make sense everywhere either.The text was updated successfully, but these errors were encountered: