Show / Hide Table of Contents

Class HttpResponseMessageExtensions

Extensions for HttpResponseMessage to help with parasing errors as returned by some Google services.

Inheritance
object
HttpResponseMessageExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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 response or its Content are null.
  • Or the deserialization attempt throws a Newtonsoft.Json.JsonException.
  • Or the deserilization attempt returns null.
Any exception thrown while reading the response Content will be bubbled up. Otherwise this method will return the deserialized Google.Apis.Requests.RequestError.
In this article
Back to top Generated by DocFX