Creating a Content–Type Header

Depending on how the RESTlet is written, calls to that RESTlet may require a request body and the RESTlet may return data which you want to use.

When a RESTlet requires a request body, you must tell NetSuite how your request body will be formatted. When a RESTlet returns data, you might want to specify the format of the data that is returned. Both of these formats must be the same. You specify these formats by adding a Content-Type header to your request. When a Content-Header is required but is missing, the request fails with an http error code reading 206: Partial Content.

Supported Content-Type headers are:

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.

Related Topics

SuiteScript 2.x RESTlet Reference
Deploying a RESTlet
Identifying a RESTlet in a Call
Selecting an HTTP/HTTPS Method for Calling a RESTlet
SuiteScript 2.x RESTlet Error Handling
RESTlet Governance and Security

General Notices