Skip to content

ExecuteJson

Executes the request and returns the response body as a JavaScript object.

1
myRestRequest.ExecuteJson():object

Returns

The response body as a JavaScript object.

Remarks

Unlike the RestRequest.Execute method, this method verifies that the server's status code is OK (HTTP 200). If not, an exception is thrown.

Example

1
2
3
4
5
6
var client = $Rest.Create('http://targetserver');
var request = client.Request();

request.AddParameter('x', 1);

var result = request.ExecuteJson();

See Also