Creating a Content–Type Header

Depending on how you write your RESTlet, you might need to send a request body—and your RESTlet might return data you’ll want to use.

If your RESTlet needs a request body, add a Content-Type header for the right format.

Note:

If you leave out a required Content-Type header, your request will fail with a 415: Unsupported Media Type error.

The following are suggested Content-Type headers:

Remember, Content-Type headers are case-sensitive—make sure you type them exactly as shown:

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, keep the following points in mind:

Related Topics

General Notices