C Media Types
Media types, also called MIME types or content types, define the allowed resource structure of the payload exchanged between the client and server. All REST API media types are based on JSON. Resources accessed in the web application fall under the application
type and json
subtype.
REST APIs use one of the media types listed in the table below. The types are defined such that the media type does not vary with the business object backing the resource. Note that the value of the accept header depends on the context of the invocation. Links to the JSON token structure of the REST API media types are provided in the following table.
Note:
As an alternative to specifying the supported media types, request accept headers passed with the REST API call can specify application/json
when a superset of all supported media types may be accepted in the response.
Table C-1 Media Types Supported by REST APIs
Media Type | Invocation Context | Description |
---|---|---|
|
GET method |
Represents the format for all resource collections returned by the REST API call. All attributes are automatically generated by the framework. Only the content of the For an example, see Describing a Resource Collection. |
|
GET method POST method PATCH method |
Represents the format for all resource items returned by the REST API call. Also represents the format for a resource item in a POST or PATCH request payload. Also represents the format for a resource item in a POST or PATCH request payload. Only the attribute |
|
GET method |
Describes the resource and its elements. For an example, see Retrieving the Resource Catalog Describe |
|
POST method |
Describes a set of operations to be performed, where the operation consists of a set of parts and each part represents a request. The batch request is executed in one single transaction. For an example, see Making Batch Requests. |
|
any |
Describes the exception payload error response for a request made with an error. To use this media type and obtain the exception details in an error response payload, the request must be made with REST API framework version 4 (or later) enabled. For an example, see Obtaining an Exception Payload Error Response. |