Skip to content

ExecuteString

Executes the request and returns the response body as a string.

1
myRestRequest.ExecuteString():string

Returns

The response body as a string.

Remarks

Unlike RestRequest.Execute, this method verifies the response status: by default, OK (200) and NoContent (204) are accepted. Otherwise, an exception is thrown.

Examples

Read a text response

1
2
3
4
5
var csv = $Rest.Create('https://reports.example.com/')
    .Request('daily.csv')
    .ExecuteString();

var rows = csv.split('\n');

See Also