11

I mean, can I expect to work

POST / HTTP/1.1
Content-Type: application/octet-stream
Content-Length: 27

[27 bytes of binary data]

And the binary data is arbitrary binary data, not Base64 encoded with all 8 bits in use, not 7 bits. The receiving application is custom application that would know what to do with the data.

Of course, I could test, but I need to know if this is likely to work with real server and over web, not just between both client and server running on a localhost.

2 Answers 2

12

Yes. HTTP/1.1 message header blocks are text, but the payload of messages can be arbitrary binary data.

Sign up to request clarification or add additional context in comments.

Comments

9

RFC 2046 defines the octet-stream subtype as follows:

4.5.1. Octet-Stream Subtype

The "octet-stream" subtype is used to indicate that a body contains arbitrary binary data.

And RFC 2045 defines binary data in context of MIME messages as follows:

2.9. Binary Data

"Binary data" refers to data where any sequence of octets whatsoever is allowed.

4 Comments

That's not really the reason why HTTP - indeed - can transport binary.
@JulianReschke So what’s the actual reason?
@JulianReschke That’s not really a reasonable explanation.
Gumbo: well, it's the explanation. (WRT answer: you can send application/octet-stream over Mail, but you need additional encodings for that; this proves why your line of argument is totally misleading: you're looking at the wrong layer)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.