RestRequest¶
Defines a request to a REST service.
Capabilities¶
Request Definition¶
- RestRequest.Method: Gets or sets the HTTP method of the request.
Request Parameters and Body¶
- RestRequest.AddFile: Adds the specified file to the request.
- RestRequest.AddFileBase64: Adds specified Base64-encoded file content to the request.
- RestRequest.AddFileBody: Adds a file as the request body.
- RestRequest.AddFileBodyBase64: Adds a specified Base64-encoded file as the request body.
- RestRequest.AddHeader: Adds a new HTTP header to the request.
- RestRequest.AddObject: Adds a new object to the request as the request body.
- RestRequest.AddParameter: Adds a new parameter to the request body.
- RestRequest.AddQueryParameter: Registers a new query string parameter.
- RestRequest.AddUrlParameter: Registers a new URL parameter.
- RestRequest.AddXml: Adds new XML content to the request.
- RestRequest.SetFileFragment: Sets the buffer size for partial upload fragment size.
Execution¶
- RestRequest.Delete: Performs the request using the DELETE method.
- RestRequest.DeleteAsync: Performs the request asynchronously using the DELETE method.
- RestRequest.Execute: Executes the request and returns the target server response.
- RestRequest.ExecuteAsync: Executes the request asynchronously and returns the target server response.
- RestRequest.ExecuteJson: Executes the request and returns the response body as a JavaScript object.
- RestRequest.ExecuteJsonAsync: Executes the request asynchronously and returns the response body as a JavaScript object.
- RestRequest.ExecuteString: Executes the request and returns the response body as a string.
- RestRequest.ExecuteStringAsync: Executes the request asynchronously and returns the response body as a string.
- RestRequest.ExecuteXml: Executes the request and returns the response body as an XML node.
- RestRequest.ExecuteXmlAsync: Executes the request asynchronously and returns the response body as an XML node.
- RestRequest.Get: Performs the request using the GET method.
- RestRequest.GetAsync: Performs the request asynchronously using the GET method.
- RestRequest.Patch: Performs the request using the PATCH method.
- RestRequest.PatchAsync: Performs the request asynchronously using the PATCH method.
- RestRequest.Post: Performs the request using the POST method.
- RestRequest.PostAsync: Performs the request asynchronously using the POST method.
- RestRequest.Put: Performs the request using the PUT method.
- RestRequest.PutAsync: Performs the request asynchronously using the PUT method.
Request Expectations¶
- RestRequest.Expect: Sets the expected status code to verify the request.