https.request(options)
Method Description |
Sends an HTTPS request.
Important:
If negotiating a connection to the destination server exceeds 5 seconds, a connection timeout occurs. If transferring a payload to the server exceeds 45 seconds, a request timeout occurs. This may result in the |
Returns |
|
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
10 units |
Module |
|
Since |
2015.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
enum |
required |
The HTTPS request method. Use https.Method to set this value. |
2015.2 |
|
string |
required |
The HTTPS URL being requested. |
2015.2 |
|
string | Object |
optional |
The POST data if the method is
Note:
If the method is |
2015.2 |
|
string[] |
optional |
An array of string GUIDs. These GUIDS are searched for in the |
2015.2 |
|
Object |
optional |
The HTTPS headers. For more information, see HTTPS Header Information. |
2015.2 |
Errors
Error Code |
Message |
Thrown If |
---|---|---|
|
An untrusted, unsupported, or invalid certificate was found for this host. |
The client and server could not negotiate the desired level of security. The connection is no longer usable. You may also receive this error if the domain name in the
|
|
The URL must be a fully qualified HTTP/HTTPS URL. |
An invalid URL is specified in the |
|
Missing a required argument: {param name} |
The |
|
This script executes a recursive function that has exceeded the limit for the number of times a script can call itself using an HTTP request. Please examine the script for a potential infinite recursion problem. |
A script is calling back into itself recursively using an HTTP/HTTPS request. |
|
The host you are trying to connect to has exceeded the maximum allowed response time. |
If negotiating a connection to the destination server exceeds 5 seconds, a connection timeout occurs. If transferring a payload to the server exceeds 45 seconds, a request timeout occurs. |
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
...
var headerObj = {
name: 'Accept-Language',
value: 'en-us'
};
var response = https.request({
method: https.Method.GET,
url: 'https://www.testwebsite.com',
body: 'My REQUEST Data',
headers: headerObj
});
...
// Add additional code