ServerRequest.body

Note:

The content in this help topic pertains to SuiteScript 2.0.

Property Description

The server request body.

Type

string (read-only)

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Module

N/https Module

Since

2015.2

Errors

Error Code

Thrown If

READ_ONLY_PROPERTY

You attempted to edit this property. This property is read-only.

Syntax
Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/https Module Script Samples.

          // Add additional code 
...
log.debug({
    title: 'Server Request Body',
    details: request.body
});
... 
// Add additional code 

        

Code Samples

Note:

This script sample uses the define function, which is required for an entry point script (a script you attach to a script record and deploy). You must use the require function if you want to copy the script into the SuiteScript Debugger and test it. For more information, see SuiteScript 2.x Global Objects

          /**
 *@NApiVersion 2.x
 *@NScriptType Suitelet
 */
 define([], function() {
    function onRequest(context) {        
        var body = context.request.body; // this is a string
        ...
        // Add additional code
        ... 
    }
 
    return {
        onRequest: onRequest
    };
}); 

        

Related Topics

https.ServerRequest
N/https Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices