Developer Function: Server Script: httpClient.Put
Overview¶
Used when issuing a PUT method using "httpClient" in "Server Script".
Syntax¶
Parameters¶
There are no parameters.
Return Value¶
String-type return value
Usage Example¶
The following example issues a PUT method to an external API server and logs the results.
JavaScript¶
let data = {
data1: 'abc',
data2: '123'
}
httpClient.RequestUri = 'https://servername/api/.....';
httpClient.Content = JSON.stringify(data);
let response = httpClient.Put();
if(httpClient.IsSuccess) {
context.Log('Success: ' + response);
}else{
context.Log('Error: (' + httpClient.StatusCode + ')' + response);
}