Skip to content

Execute

Executes the request with its RestRequest.Method and returns the response.

1
myRestRequest.Execute():RestResponse

Returns

A RestResponse instance containing the server's response.

Remarks

This method does not verify the response status. Check RestResponse.StatusCode or call RestResponse.Verify.

Examples

Check the status code

1
2
3
4
5
6
7
var response = $Rest.Create('https://api.example.com/')
    .Request('health')
    .Execute();

if (response.StatusCode !== 'OK') {
    console.warn('Service is not available: ' + response.StatusCodeDescription);
}

See Also