Support for application/octet-stream MIME Attachment (Binary) Payloads
A MIME attachment with the content type
application/octet-stream
is
a binary file. Typically, it is an application or a document that is
opened in an application such as a spreadsheet or word processor. If
the attachment has a filename extension associated with it, you may
be able to determine what type of file it is.
For example,
an .exe
extension indicates a
Windows or DOS program (executable), while a file
ending in .doc
is probably
meant to be opened in Microsoft Word.
The
application/octet-stream
MIME
type is used for unknown binary files. It
preserves the file contents, but requires the
receiver to determine file type, for example, from
the filename extension. The Internet media
type for an arbitrary byte stream
is application/octet-stream
.
To use this feature, select the Binary option from the invoke Request/Response page when configuring the adapter as an invoke. When you select this option, you do not need to provide a schema because the payload has no structure.
This feature works with the
application/octet-stream
MIME
type and any other type that can be sent as binary
bytes. For example, the REST Adapter can send outbound requests or process
outbound responses using the
application/pdf
,
application/zip
,
image/jpeg
,
image/png
, and other formats.
Commonly used types shown in the dropdown are:
-
application/octet-stream
-
application/pdf
-
application/msword
-
application/zip
-
image/jpeg
-
image/png
-
image/bmp
-
image/gif
There is also a text box to provide
a type not listed in the dropdown list (for
example, video/mp4
or
text/csv
).
The following screenshots show how binary payloads can be mapped.