HTTPClient

HTTP client for making web requests.

xxml
Language::Network

Methods

MethodParametersReturnsDescription
ConstructorHTTPClient^Create HTTP client
setHeaderkey: String^, value: String^NoneSet request header
setTimeoutmilliseconds: Integer^NoneSet timeout
performGeturl: String^HTTPResponse^GET request
performPosturl: String^, data: String^HTTPResponse^POST request

Examples

HTTP Client Usage

xxml
Instantiate Network::HTTPClient^ As <client> = Network::HTTPClient::Constructor();
Run client.setHeader(String::Constructor("Accept"), String::Constructor("application/json"));
Run client.setTimeout(Integer::Constructor(5000));

Instantiate Network::HTTPResponse^ As <response> = client.performGet(
    String::Constructor("https://api.example.com/data")
);

If (response.isSuccess()) -> {
    Run Console::printLine(response.getBody());
}

See Also