Skip to content

Create

Creates a new RestClient instance.

1
myRest.Create(url: string, service: string, scope: string, identity: string):RestClient

Parameters

string url
    The target URL for the REST client.

string service
    The name of the service to authenticate with. Optional.

string scope
    The scope of the REST operation. Optional.

string identity
    The identity to impersonate. Optional.

Returns

A new RestClient instance.

Remarks

The service, scope, and identity parameters are optional. If not specified, the REST client will not be authenticated.

Creating a REST client and executing a request:

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

var request = client.Request();

request.AddParameter('x', 1);

var response = request.Execute();

See Also