Class HttpResponseMessageExtensions
- Namespace
- Songhay.Extensions
- Assembly
- SonghayCore.dll
Extensions of HttpResponseMessage.
public static class HttpResponseMessageExtensions
- Inheritance
-
HttpResponseMessageExtensions
- Inherited Members
Methods
DownloadByteArrayToFileAsync(HttpResponseMessage?, FileSystemInfo?)
public static Task DownloadByteArrayToFileAsync(this HttpResponseMessage? response, FileSystemInfo? fileInfo)
Parameters
responseHttpResponseMessageThe response.
fileInfoFileSystemInfoThe file information.
Returns
DownloadByteArrayToFileAsync(HttpResponseMessage?, string)
public static Task DownloadByteArrayToFileAsync(this HttpResponseMessage? response, string target)
Parameters
responseHttpResponseMessageThe response.
targetstringThe target.
Returns
DownloadStringToFileAsync(HttpResponseMessage?, FileSystemInfo?)
public static Task DownloadStringToFileAsync(this HttpResponseMessage? response, FileSystemInfo? fileInfo)
Parameters
responseHttpResponseMessageThe response.
fileInfoFileSystemInfoThe file information.
Returns
DownloadStringToFileAsync(HttpResponseMessage?, string?)
public static Task DownloadStringToFileAsync(this HttpResponseMessage? response, string? target)
Parameters
responseHttpResponseMessageThe response.
targetstringThe target.
Returns
IsMovedOrRedirected(HttpResponseMessage?)
Returns true when HttpResponseMessage
is Moved, MovedPermanently
or Redirect.
public static bool IsMovedOrRedirected(this HttpResponseMessage? response)
Parameters
responseHttpResponseMessageThe response.
Returns
StreamToInstanceAsync<TInstance>(HttpResponseMessage?)
Serializes the HttpResponseMessage
to the specified TInstance
public static Task<TInstance?> StreamToInstanceAsync<TInstance>(this HttpResponseMessage? response)
Parameters
responseHttpResponseMessageThe response.
Returns
- Task<TInstance>
Type Parameters
TInstanceThe 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
responseHttpResponseMessageThe response.
optionsJsonSerializerOptions
Returns
- Task<TInstance>
Type Parameters
TInstanceThe type of the instance.
Remarks
This method uses the Microsoft API to deserialize.