Skip to main content

Definition

Assembly: CloudNimble.Breakdance.WebApi.dll Namespace: CloudNimble.Breakdance.WebApi Inheritance: System.Object

Syntax

CloudNimble.Breakdance.WebApi.HttpClientHelpers

Methods

GetTestableHttpRequestMessage

Gets an HttpRequestMessage instance properly configured to be used to make test requests.

Syntax

public static System.Net.Http.HttpRequestMessage GetTestableHttpRequestMessage(System.Net.Http.HttpMethod httpMethod, string host = "http://localhost/", string routePrefix = "api/tests/", string resource = "", string acceptHeader = "application/json", object payload = null, Newtonsoft.Json.JsonSerializerSettings jsonSerializerSettings = null)

Parameters

NameTypeDescription
httpMethodSystem.Net.Http.HttpMethodThe HttpMethod to use for the request.
hoststringThe hostname to use for this request. Defaults to “http://localhost”, only change it if that collides with other services running on the local machine.
routePrefixstringThe routePrefix corresponding to the route already mapped in MapRestierRoute or GetTestableConfiguration. Defaults to “api/test”, only change it if absolutely necessary.
resourcestringThe resource on the API to be requested. Defaults to an empty string.
acceptHeaderstringThe inbound MIME types to accept. Defaults to “application/json”.
payloadobject-
jsonSerializerSettingsNewtonsoft.Json.JsonSerializerSettings-

Returns

Type: System.Net.Http.HttpRequestMessage An HttpRequestMessage that is ready to be sent through an HttpClient instance configured for the test.