Improve this Doc View Source

Class UriActionExtensions

Uri extension which perform an action

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

Methods

| Improve this Doc View Source

DeleteAsync<TResponse>(Uri, CancellationToken)

Method to Delete content

Declaration
public static Task<TResponse> DeleteAsync<TResponse>(Uri uri, CancellationToken token = null)where TResponse : class
Parameters
Type Name Description
System.Uri uri

Uri to send the delete to

System.Threading.CancellationToken token

CancellationToken

Returns
Type Description
System.Threading.Tasks.Task<TResponse>

TResponse

| Improve this Doc View Source

GetAsAsync<TResponse>(Uri, CancellationToken)

Get the response as the specified type

Declaration
public static Task<TResponse> GetAsAsync<TResponse>(Uri uri, CancellationToken token = null)where TResponse : class
Parameters
Type Name Description
System.Uri uri

An Uri to specify the download location

System.Threading.CancellationToken token

CancellationToken

Returns
Type Description
System.Threading.Tasks.Task<TResponse>

TResponse

| Improve this Doc View Source

HeadAsync(Uri, CancellationToken)

Retrieve only the content headers, by using the HTTP HEAD method

Declaration
public static Task<HttpContentHeaders> HeadAsync(Uri uri, CancellationToken token = null)
Parameters
Type Name Description
System.Uri uri

Uri to get HEAD for

System.Threading.CancellationToken token

CancellationToken

Returns
Type Description
System.Threading.Tasks.Task<System.Net.Http.Headers.HttpContentHeaders>

HttpContentHeaders

| Improve this Doc View Source

LastModifiedAsync(Uri, CancellationToken)

Get LastModified for a URI

Declaration
public static Task<DateTimeOffset> LastModifiedAsync(Uri uri, CancellationToken token = null)
Parameters
Type Name Description
System.Uri uri

Uri

System.Threading.CancellationToken token

CancellationToken

Returns
Type Description
System.Threading.Tasks.Task<System.DateTimeOffset>

DateTime

| Improve this Doc View Source

PostAsync(Uri, Object, CancellationToken)

Method to Post content, ignore response

Declaration
public static Task PostAsync(Uri uri, object content, CancellationToken token = null)
Parameters
Type Name Description
System.Uri uri

Uri to post to

System.Object content

Content to post

System.Threading.CancellationToken token

CancellationToken

Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

PostAsync<TResponse>(Uri, Object, CancellationToken)

Method to Post content

Declaration
public static Task<TResponse> PostAsync<TResponse>(Uri uri, object content, CancellationToken token = null)where TResponse : class
Parameters
Type Name Description
System.Uri uri

Uri to post to

System.Object content

Content to post

System.Threading.CancellationToken token

CancellationToken

Returns
Type Description
System.Threading.Tasks.Task<TResponse>

TResponse

| Improve this Doc View Source

PutAsync<TResponse>(Uri, Object, CancellationToken)

Method to Put content

Declaration
public static Task<TResponse> PutAsync<TResponse>(Uri uri, object content, CancellationToken token = null)where TResponse : class
Parameters
Type Name Description
System.Uri uri

Uri to post to

System.Object content

Content to post

System.Threading.CancellationToken token

CancellationToken

Returns
Type Description
System.Threading.Tasks.Task<TResponse>

TResponse