Encode into binary only if needed

This way we don't make unnecessarily complicated decoding of strings when we really don't need to. We also avoid OPTIONS requests when the octet-stream content-type is not really needed.

Attached is a test case that fails currently, but starts passing with the applied check for binary.