Class HttpResponseMessageExtensions
Extensions for HttpResponseMessage to help with parasing errors as returned by some Google services.
Inherited Members
Namespace: Google.Apis.Responses
Assembly: Google.Apis.dll
Syntax
public static class HttpResponseMessageExtensions
Methods
DeserializeErrorAsync(HttpResponseMessage, string, ISerializer)
Attempts to deserialize a Google.Apis.Requests.RequestError from the response.
Declaration
public static Task<RequestError> DeserializeErrorAsync(this HttpResponseMessage response, string name, ISerializer serializer)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpResponseMessage | response | |
| string | name | |
| ISerializer | serializer |
Returns
| Type | Description |
|---|---|
| Task<RequestError> |
Remarks
This method will throw a Google.GoogleApiException if:
- The
responseor its Content are null. - Or the deserialization attempt throws a Newtonsoft.Json.JsonException.
- Or the deserilization attempt returns null.
response Content
will be bubbled up.
Otherwise this method will return the deserialized Google.Apis.Requests.RequestError.