Skip to content

Developer Features: Server Script: httpClient.Patch

Overview

Used when issuing a PATCH method using "httpClient" in "Server Script".

Syntax

httpClient.Patch();

Parameters

No parameters

Return Value

Return value of string type

Usage Example

The following example issues a PATCH method to an external API server and outputs the results to the log.

JavaScript
let data = {
    data1: 'abc',
    data2: '123'
}
httpClient.RequestUri = 'https://servername/api/.....';
httpClient.Content = JSON.stringify(data);
let response = httpClient.Patch();
if (httpClient.IsSuccess) {
    context.Log('Success: ' + response);
} else {
    context.Log('Error: (' + httpClient.StatusCode + ')' + response);
}