RESTAPIRequestBody - Scoped, Global
-
- UpdatedJan 30, 2025
- 3 minutes to read
- Yokohama
- API reference
The RESTAPIRequestBody API provides methods that allow you to access the body content of a scripted REST API request in scripts.
This API runs in the sn_ws
namespace.
RESTAPIRequestBody - data
The content of the request body.
Name | Type | Description |
---|---|---|
data | Object or Array | The request content. This can be a single object or an array of objects depending on the request. |
Example
RESTAPIRequestBody - dataStream
The content of the request body, as a stream.
Name | Type | Description |
---|---|---|
dataStream | Object | The content of the request body. You can pass the stream to a separate API, such as to create an attachment from the request or forward the request to a different endpoint. |
Example
RESTAPIRequestBody - dataString
The content of the request body, as a String.
Name | Type | Description |
---|---|---|
dataString | String | The content of the request body. |
Example
RESTAPIRequestBody - hasNext()
Determines if there are additional entries in the request body.
Use this method with the nextEntry() method to iterate over multiple request body entries.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
boolean | Flag indicating whether there are additional entries in the request
body. Possible values:
|
Example
RESTAPIRequestBody - nextEntry()
Retrieve one entry from the request body as a script object.
Use this method with the hasNext() method to iterate over multiple request body entries.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Object | A single entry from the request body. |
Example
Example
This example demonstrates using hasNext() with nextEntry().