http.get(options)
Method Description |
Sends an HTTP GET request. |
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 |
---|---|---|---|---|
|
string |
required |
The HTTP URL being requested. |
2015.2 |
|
Object |
optional |
The HTTP headers. For more information, see HTTP 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 |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete HTTP script example, see N/http Module Script Samples.
// Add additional code
...
var headerObj = {
name: 'Accept-Language',
value: 'en-us'
};
var response = http.get({
url: 'http://www.google.com',
headers: headerObj
});
...
// Add additional code