C# Class Amido.Testing.WebApi.WebApiRequest

Helper class for creating a WebTestRequest.
Datei anzeigen Open project: amido/Amido.Testing

Public Methods

Method Description
AddAcceptHeader ( AcceptHeader acceptHeader ) : WebApiRequest

Helper method for adding an Accept header to the request.

AddBody ( string bodyString ) : WebApiRequest

The request body as a string.

AddContentType ( ContentType contentType ) : WebApiRequest

Helper method for adding a content type to the request.

AddFormParameter ( string key, string value ) : WebApiRequest

AddHeader ( string key, string value ) : WebApiRequest

Add a header to the request.

AddQueryStringParameter ( string key, string value ) : WebApiRequest

Adds a query string parameter to the request url.

Create ( ) : WebTestRequest

Creates a WebTestRequest using the properties and values of the configured WebApiRequest.

SetCertificationValidation ( bool validationResult ) : WebApiRequest

Helper method for overriding the certificate validation callback result.

Url ( string url ) : WebApiRequest

Static method for constructing a new WebApiRequest.

WithVerb ( Verb httpVerb ) : WebApiRequest

Sets the http verb to be used in the request.

Protected Methods

Method Description
WebApiRequest ( string url ) : System

Private Methods

Method Description
AddRequestBody ( WebTestRequest request ) : void
CreateRequest ( String requestUrl ) : WebTestRequest
SetRequestHeaders ( WebTestRequest request ) : void

Method Details

AddAcceptHeader() public method

Helper method for adding an Accept header to the request.
public AddAcceptHeader ( AcceptHeader acceptHeader ) : WebApiRequest
acceptHeader AcceptHeader The .
return WebApiRequest

AddBody() public method

The request body as a string.
public AddBody ( string bodyString ) : WebApiRequest
bodyString string The string to be used for the request body.
return WebApiRequest

AddContentType() public method

Helper method for adding a content type to the request.
public AddContentType ( ContentType contentType ) : WebApiRequest
contentType ContentType The .
return WebApiRequest

AddFormParameter() public method

public AddFormParameter ( string key, string value ) : WebApiRequest
key string
value string
return WebApiRequest

AddHeader() public method

Add a header to the request.
public AddHeader ( string key, string value ) : WebApiRequest
key string The key of the header.
value string The value of the header.
return WebApiRequest

AddQueryStringParameter() public method

Adds a query string parameter to the request url.
public AddQueryStringParameter ( string key, string value ) : WebApiRequest
key string The key of the querystring parameter.
value string The value of the querystring parameter.
return WebApiRequest

Create() public method

Creates a WebTestRequest using the properties and values of the configured WebApiRequest.
public Create ( ) : WebTestRequest
return WebTestRequest

SetCertificationValidation() public method

Helper method for overriding the certificate validation callback result.
public SetCertificationValidation ( bool validationResult ) : WebApiRequest
validationResult bool the value to return on the certificate validation callback.
return WebApiRequest

Url() public static method

Static method for constructing a new WebApiRequest.
public static Url ( string url ) : WebApiRequest
url string The url. Zero indexed placeholders can be used to tokenise url, exactly like using string.Format.
return WebApiRequest

WebApiRequest() protected method

protected WebApiRequest ( string url ) : System
url string
return System

WithVerb() public method

Sets the http verb to be used in the request.
public WithVerb ( Verb httpVerb ) : WebApiRequest
httpVerb Verb The .
return WebApiRequest