Creating a Content–Type Header

Depending on how the RESTlet is written, requests to that RESTlet may require a request body in its HTTP request. The RESTlet may also return an HTTP response with data that you may want to use.

If your RESTlet requires a request body, you need to add a Content-Type header to the request body with its corresponding format.

Note:

When a Content-Header is required but is missing, the request fails with an HTTP error code reading 415: Unsupported Media Type.

The following are suggested Content-Type headers:

Note that Content-Type headers are case-sensitive and must be specified as follows:

For an example of a shell script that generates a Content-Type header, see Example of a Shell Script that Calls a RESTlet.

If your RESTlet returns data, take note of the following:

Related Topics

General Notices