ServerResponse.setHeader(options)
Method Description |
Sets the value of a response header. For more information, see HTTPS Header Information. |
Returns |
void |
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2015.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required |
The name of the header. |
2015.2 |
|
string |
required |
The value used to set the header. |
2015.2 |
Errors
Error Code |
Message |
Thrown If |
---|---|---|
|
One or more headers are not valid. |
The header name or value is invalid. |
|
Missing a required argument: {param name} |
The |
Syntax
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
...
serverResponse.setHeader({
name: 'Accept-Language',
value: 'en-us',
});
...
// Add additional code