Improve this Doc View Source

Class HttpRequestMessageFactory

Dapplo.HttpExtension uses the HttpRequestMessage to send the requests. This makes it a lot more flexible to use Accept headers and other stuff This is the factory for it.

Inheritance
System.Object
HttpRequestMessageFactory
Namespace:Dapplo.HttpExtensions.Factory
Assembly:Dapplo.HttpExtensions.dll
Syntax
public class HttpRequestMessageFactory

Methods

| Improve this Doc View Source

Create(HttpMethod, Uri, Type, Type, Object)

Create a HttpRequestMessage for the specified method

Declaration
public static HttpRequestMessage Create(HttpMethod method, Uri requestUri, Type resultType = null, Type contentType = null, object content = null)
Parameters
Type Name Description
System.Net.Http.HttpMethod method

Method to create the request message for

System.Uri requestUri

the target uri for this message

System.Type resultType

Type

System.Type contentType

Type

System.Object content

content to convert to HttpContent

Returns
Type Description
System.Net.Http.HttpRequestMessage

HttpRequestMessage

| Improve this Doc View Source

Create<TResponse>(HttpMethod, Uri)

Create a HttpRequestMessage for the specified method

Declaration
public static HttpRequestMessage Create<TResponse>(HttpMethod method, Uri requestUri)where TResponse : class
Parameters
Type Name Description
System.Net.Http.HttpMethod method

Method to create the request message for

System.Uri requestUri

the target uri for this message

Returns
Type Description
System.Net.Http.HttpRequestMessage

HttpRequestMessage

| Improve this Doc View Source

Create<TResponse, TContent>(HttpMethod, Uri, TContent)

Create a HttpRequestMessage for the specified method

Declaration
public static HttpRequestMessage Create<TResponse, TContent>(HttpMethod method, Uri requestUri, TContent content = null)where TResponse : class where TContent : class
Parameters
Type Name Description
System.Net.Http.HttpMethod method

Method to create the request message for

System.Uri requestUri

the target uri for this message

TContent content

HttpContent

Returns
Type Description
System.Net.Http.HttpRequestMessage

HttpRequestMessage

| Improve this Doc View Source

CreateDelete<TResponse>(Uri)

Create a HttpRequestMessage for the DELETE method

Declaration
public static HttpRequestMessage CreateDelete<TResponse>(Uri requestUri)where TResponse : class
Parameters
Type Name Description
System.Uri requestUri

the target uri for this message

Returns
Type Description
System.Net.Http.HttpRequestMessage

HttpRequestMessage

| Improve this Doc View Source

CreateGet<TResponse>(Uri)

Create a HttpRequestMessage for the GET method

Declaration
public static HttpRequestMessage CreateGet<TResponse>(Uri requestUri)where TResponse : class
Parameters
Type Name Description
System.Uri requestUri

the target uri for this message

Returns
Type Description
System.Net.Http.HttpRequestMessage

HttpRequestMessage

| Improve this Doc View Source

CreateHead(Uri)

Create a HttpRequestMessage for the HEAD method

Declaration
public static HttpRequestMessage CreateHead(Uri requestUri)
Parameters
Type Name Description
System.Uri requestUri

the target uri for this message

Returns
Type Description
System.Net.Http.HttpRequestMessage

HttpRequestMessage

| Improve this Doc View Source

CreatePost(Uri, Object)

Create a HttpRequestMessage for the POST method

Declaration
public static HttpRequestMessage CreatePost(Uri requestUri, object content = null)
Parameters
Type Name Description
System.Uri requestUri

the target uri for this message

System.Object content

HttpContent

Returns
Type Description
System.Net.Http.HttpRequestMessage

HttpRequestMessage

| Improve this Doc View Source

CreatePost<TResponse>(Uri, Object)

Create a HttpRequestMessage for the POST method

Declaration
public static HttpRequestMessage CreatePost<TResponse>(Uri requestUri, object content = null)where TResponse : class
Parameters
Type Name Description
System.Uri requestUri

the target uri for this message

System.Object content

HttpContent

Returns
Type Description
System.Net.Http.HttpRequestMessage

HttpRequestMessage

| Improve this Doc View Source

CreatePut<TResponse>(Uri, Object)

Create a HttpRequestMessage for the PUT method

Declaration
public static HttpRequestMessage CreatePut<TResponse>(Uri requestUri, object content = null)where TResponse : class
Parameters
Type Name Description
System.Uri requestUri

the target uri for this message

System.Object content

HttpContent

Returns
Type Description
System.Net.Http.HttpRequestMessage

HttpRequestMessage