ServiceClient class
ServiceClient sends service requests and receives responses.
Constructors
Service |
The ServiceClient constructor |
Methods
send |
Send an HTTP request that is populated using the provided OperationSpec. |
send |
Send the provided httpRequest. |
Constructor Details
ServiceClient(TokenCredential | ServiceClientCredentials, ServiceClientOptions)
The ServiceClient constructor
new ServiceClient(credentials?: TokenCredential | ServiceClientCredentials, options?: ServiceClientOptions)
Parameters
- credentials
The credentials used for authentication with the service.
- options
- ServiceClientOptions
The service client options that govern the behavior of the client.
Method Details
sendOperationRequest(OperationArguments, OperationSpec, ServiceCallback<any>)
Send an HTTP request that is populated using the provided OperationSpec.
function sendOperationRequest(operationArguments: OperationArguments, operationSpec: OperationSpec, callback?: ServiceCallback<any>): Promise<RestResponse>
Parameters
- operationArguments
- OperationArguments
The arguments that the HTTP request's templated values will be populated from.
- operationSpec
- OperationSpec
The OperationSpec to use to populate the httpRequest.
- callback
-
ServiceCallback<any>
The callback to call when the response is received.
Returns
Promise<RestResponse>
sendRequest(WebResourceLike | RequestPrepareOptions)
Send the provided httpRequest.
function sendRequest(options: WebResourceLike | RequestPrepareOptions): Promise<HttpOperationResponse>
Parameters
- options
Returns
Promise<HttpOperationResponse>