restlet.createResponse(options)
Method Description |
Creates a custom RESTlet HTTP response. |
Returns |
|
Supported Script Types |
RESTlet scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Sibling Module Members |
|
Since |
2024.1 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
string |
required |
The content of the response. |
|
string |
required |
The Content-Type header of the response. This value overrides the default Content-Type header, which is the same as the Content-Type header of the RESTlet HTTP request. |
Errors
Error Code |
Error Message |
Thrown If |
---|---|---|
|
{method name}: Missing a required argument: {param name} |
A required parameter is missing. |
|
You have entered an invalid type argument: {param name} |
A parameter has an invalid type. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/scriptTypes/restlet Module Script Sample.
// Add additional code
...
return restlet.createResponse({
content: 'Hello World',
contentType: 'text/html'
});
}
...
// Add additional code