Modules
Objects/Functions
SuiteScript 2.0
{http}.post({body: {string | Object*},url: {string*},headers: {Object}})
N/http Module
http.post()
Method Description:
Sends an HTTP POST request.
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.
Returns:
http.ClientResponse or http.ServerResponse
Supported Script Types:
Server scripts
For more information, see SuiteScript 2.0 Script Types.
Governance:
10 units
Module:
N/http Module
Since:
2015.2
Search NetSuite -
https://system.netsuite.com/app/help/helpcenter.nl?search=http.post(options)
Example:
// Code Example 1
// Add additional code
//...
var headerObj = {
name: 'Accept-Language',
value: 'en-us'
};
var response = http.post({
url: 'http://www.testwebsite.com',
body: 'My POST Data',
headers: headerObj
});
var myresponse_body = response.body; // see http.ClientResponse.body
var myresponse_code = response.code; // see http.ClientResponse.code
var myresponse_headers = response.headers; // see http.Clientresponse.headers
//...
// Add additional code
//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4426024574.html