Table of Contents

Class HttpResponseMessageExtensions

Namespace
Songhay.Extensions
Assembly
SonghayCore.dll

Extensions of HttpResponseMessage.

public static class HttpResponseMessageExtensions
Inheritance
HttpResponseMessageExtensions
Inherited Members

Methods

DownloadByteArrayToFileAsync(HttpResponseMessage?, FileSystemInfo?)

Downloads Content from byte array to file.

public static Task DownloadByteArrayToFileAsync(this HttpResponseMessage? response, FileSystemInfo? fileInfo)

Parameters

response HttpResponseMessage

The response.

fileInfo FileSystemInfo

The file information.

Returns

Task

DownloadByteArrayToFileAsync(HttpResponseMessage?, string)

Downloads Content from byte array to file.

public static Task DownloadByteArrayToFileAsync(this HttpResponseMessage? response, string target)

Parameters

response HttpResponseMessage

The response.

target string

The target.

Returns

Task

DownloadStringToFileAsync(HttpResponseMessage?, FileSystemInfo?)

Downloads Content from byte array to file.

public static Task DownloadStringToFileAsync(this HttpResponseMessage? response, FileSystemInfo? fileInfo)

Parameters

response HttpResponseMessage

The response.

fileInfo FileSystemInfo

The file information.

Returns

Task

DownloadStringToFileAsync(HttpResponseMessage?, string?)

Downloads Content from byte array to file.

public static Task DownloadStringToFileAsync(this HttpResponseMessage? response, string? target)

Parameters

response HttpResponseMessage

The response.

target string

The target.

Returns

Task

IsMovedOrRedirected(HttpResponseMessage?)

public static bool IsMovedOrRedirected(this HttpResponseMessage? response)

Parameters

response HttpResponseMessage

The response.

Returns

bool

StreamToInstanceAsync<TInstance>(HttpResponseMessage?)

Serializes the HttpResponseMessage to the specified TInstance

public static Task<TInstance?> StreamToInstanceAsync<TInstance>(this HttpResponseMessage? response)

Parameters

response HttpResponseMessage

The response.

Returns

Task<TInstance>

Type Parameters

TInstance

The type of the instance.

Remarks

This method uses the Microsoft API to deserialize.

StreamToInstanceAsync<TInstance>(HttpResponseMessage?, JsonSerializerOptions?)

Serializes the HttpResponseMessage to the specified TInstance

public static Task<TInstance?> StreamToInstanceAsync<TInstance>(this HttpResponseMessage? response, JsonSerializerOptions? options)

Parameters

response HttpResponseMessage

The response.

options JsonSerializerOptions

The JsonSerializerOptions

Returns

Task<TInstance>

Type Parameters

TInstance

The type of the instance.

Remarks

This method uses the Microsoft API to deserialize.