Deserialization settings are used to customize the deserializers
        public T As <T>(DeserializationSettings deserializationSettings)
        {
            var deserializer = response.Deserializer;

            return(deserializer.Deserialize <T>(response.Body, deserializationSettings));
        }
예제 #2
0
 /// <summary>
 /// Deserializes the body of a response as a given type.
 /// </summary>
 /// <param name="deserializationSettings">The settings used to deserialize the contents</param>
 /// <typeparam name="T">The type to deserialize</typeparam>
 /// <param name="httpResponseHandler">The http response handler</param>
 /// <returns>The deserialized body</returns>
 public static async Task <T> As <T>(this Task <IHttpResponseHandler> httpResponseHandler, DeserializationSettings deserializationSettings)
 {
     return((await httpResponseHandler).As <T>(deserializationSettings));
 }
        public object As(Type type, DeserializationSettings deserializationSettings)
        {
            var deserializer = response.Deserializer;

            return(deserializer.Deserialize(response.Body, deserializationSettings, type));
        }
예제 #4
0
 /// <summary>
 /// Deserializes the body of a response as a given type.
 /// </summary>
 /// <param name="httpResponseHandler">The http response handler</param>
 /// <param name="type">The type of the object to deserialize</param>
 /// <param name="deserializationSettings">The settings used to deserialize the contents</param>
 /// <returns>The deserialized body, as an object</returns>
 public static async Task <object> As(this Task <IHttpResponseHandler> httpResponseHandler, Type type, DeserializationSettings deserializationSettings)
 {
     return((await httpResponseHandler).As(type, deserializationSettings));
 }