put

Description

Defines the function that is executed when a PUT request is sent to a RESTlet. Typically used for putting, such as inserting/upserting a NetSuite record.

Returns

An HTTP response body is returned with a string or Object.

  • Returns a string when the request Content-Type is 'text/plain'.

  • Returns an Object when the request Content-Type is 'application/json' or ‘application/xml’.

Since

Version 2015 Release 2

Parameters
Note:

The requestBody parameter is a JavaScript object. It is automatically passed to the RESTlet script entry point by NetSuite.

Parameter

Type

Required / Optional

Description

Since

requestBody

string | Object

required, but automatically passed by NetSuite

The HTTP request body.

  • The request body as a string when the request Content-Type is 'text/plain' .

  • The request body as a JavaScript Object when the request Content-Type is 'application/json' or ‘application/xml’.

Version 2015 Release 2

Related Topics

SuiteScript 2.x RESTlet Script Entry Points
delete
get
post

General Notices