http.post.promise(options)
Method Description |
Sends an HTTP POST request asynchronously. Note that when a Suitelet is invoked by this method, it will wait for all the pending promises to finish.
Note:
The parameters and errors thrown for this method are the same as those for http.post(options). For more information about promises, see Promise Object. |
Returns |
|
Synchronous Version |
|
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
10 units |
Module |
|
Since |
2015.2 |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete promise script example, see Promise Object.
// Add additional code
...
var headerObj = {
name: 'Accept-Language',
value: 'en-us'
};
http.post.promise({
url: 'http://www.google.com',
body: 'My POST Data',
headers: headerObj
})
.then(function(response){
log.debug({
title: 'Response',
details: response
});
})
.catch(function onRejected(reason) {
log.debug({
title: 'Invalid Request: ',
details: reason
});
})
...
// Add additional code