Default media types
For RESTful Web services developed using the high-level framework, you can specify the MIME type or you can accept the default. The default MIME type is based on the data type.
Table 1 lists
the default MIME types. These default MIME types are used when WSMedia is not set or when the
Accept
or Content-Type
HTTP headers are not set in
requests and responses. The data type determines the default MIME type for message
content.
A media type (also known as Multipurpose Internet Mail Extensions (MIME) type) is an identifier used by the HTTP protocol to denote message content. The format is based on standards from the Internet Assigned Numbers Authority (IANA).
Data type | Example | MIME type |
---|---|---|
Simpletype | Simple types are data structures that represent a simple value like strings,
numbers, and
booleans.
|
text/plain |
Record (only) | A structure of type RECORD that defines a fixed number of
elements.
|
application/json |
Record and array |
A structured type like a dynamic array or a record with dynamic elements like an array
and all other types supported by the BDL to
JSON conversion class.
Static arrays are not supported. |
application/json The default MIME type for records and arrays in the message
response or request is JSON ( |
BYTE | A structured BYTE data
type that defines a large object structure for any binary data, such as images or
sounds.
|
application/octet-stream |
The Image file type (image/*
)
A special media type identifies an image file. It consists of an identifier and a wildcard
(image/*
) Set in WSMedia
, this type allows the Web service to
handle all image file types: .jpeg, .png, and so on. For
an example, see Attach files with WSAttachment and WSMedia.