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
response
HttpResponseMessageThe response.
fileInfo
FileSystemInfoThe file information.
Returns
DownloadByteArrayToFileAsync(HttpResponseMessage?, string)
public static Task DownloadByteArrayToFileAsync(this HttpResponseMessage? response, string target)
Parameters
response
HttpResponseMessageThe response.
target
stringThe target.
Returns
DownloadStringToFileAsync(HttpResponseMessage?, FileSystemInfo?)
public static Task DownloadStringToFileAsync(this HttpResponseMessage? response, FileSystemInfo? fileInfo)
Parameters
response
HttpResponseMessageThe response.
fileInfo
FileSystemInfoThe file information.
Returns
DownloadStringToFileAsync(HttpResponseMessage?, string?)
public static Task DownloadStringToFileAsync(this HttpResponseMessage? response, string? target)
Parameters
response
HttpResponseMessageThe response.
target
stringThe target.
Returns
IsMovedOrRedirected(HttpResponseMessage?)
Returns true
when HttpResponseMessage
is Moved, MovedPermanently
or Redirect.
public static bool IsMovedOrRedirected(this HttpResponseMessage? response)
Parameters
response
HttpResponseMessageThe response.
Returns
StreamToInstanceAsync<TInstance>(HttpResponseMessage?)
Serializes the HttpResponseMessage
to the specified TInstance
public static Task<TInstance?> StreamToInstanceAsync<TInstance>(this HttpResponseMessage? response)
Parameters
response
HttpResponseMessageThe 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
HttpResponseMessageThe response.
options
JsonSerializerOptions
Returns
- Task<TInstance>
Type Parameters
TInstance
The type of the instance.
Remarks
This method uses the Microsoft API to deserialize.