Class HttpResponseMessageExtensions
Helper methods for HttpResponseMessage.
Inherited Members
Namespace: Unity.Cloud.Common
Assembly: Unity.Cloud.Common.dll
Syntax
public static class HttpResponseMessageExtensions
  Methods
GetContentAsString(HttpResponseMessage)
Gets a string representing the content of an HttpResponseMessage.
Declaration
[Obsolete("Use GetContentAsStringAsync instead.")]
public static Task<string> GetContentAsString(this HttpResponseMessage response)
  Parameters
| Type | Name | Description | 
|---|---|---|
| HttpResponseMessage | response | The HTTP response message.  | 
      
Returns
| Type | Description | 
|---|---|
| Task<string> | 
GetContentAsStringAsync(HttpResponseMessage)
Gets a string representing the content of an HttpResponseMessage.
Declaration
public static Task<string> GetContentAsStringAsync(this HttpResponseMessage response)
  Parameters
| Type | Name | Description | 
|---|---|---|
| HttpResponseMessage | response | The HTTP response message.  | 
      
Returns
| Type | Description | 
|---|---|
| Task<string> | 
JsonDeserializeAsync<T>(HttpResponseMessage)
Deserializes the content of an HttpResponseMessage to a specified type.
Declaration
public static Task<T> JsonDeserializeAsync<T>(this HttpResponseMessage response)
  Parameters
| Type | Name | Description | 
|---|---|---|
| HttpResponseMessage | response | The HTTP response message to deserialize.  | 
      
Returns
| Type | Description | 
|---|---|
| Task<T> | 
Type Parameters
| Name | Description | 
|---|---|
| T | The type to deserialize to.  |