Skip to content

Developer Function: Server Script: httpClient.Get

Overview

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

Syntax

httpClient.Get();

Parameters

There are no parameters.

Return Value

String-type return value

Usage Example

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

JavaScript
httpClient.RequestUri = 'https://servername/api/.....';
let response = httpClient.Get();
if(httpClient.IsSuccess) {
    context.Log('Success: ' + response);
}else{
    context.Log('Error: (' + httpClient.StatusCode + ')' + response);
}