public static class HttpResponseMessageExtensions
Extensions for HttpResponseMessage to help with parasing errors as returned by some Google services.
Namespace
Google.Apis.ResponsesAssembly
Google.Apis.dll
Methods
DeserializeErrorAsync(HttpResponseMessage, string, ISerializer)
public static Task<RequestError> DeserializeErrorAsync(this HttpResponseMessage response, string name, ISerializer serializer)
Attempts to deserialize a RequestError from the response
.
Parameters | |
---|---|
Name | Description |
response |
HttpResponseMessage |
name |
string |
serializer |
ISerializer |
Returns | |
---|---|
Type | Description |
TaskRequestError |
This method will throw a GoogleApiException if:
- The
response
or 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 RequestError.