Ejemplo n.º 1
0
        public static void AddNewtonsoftResponseHandler(this IRestClient restClient, NewtonsoftRestsharpJsonSerializer serializer)
        {
            string[] contentTypes = new string[]
            {
                "application/json",
                "text/json",
                "text/x-json",
                "text/javascript",
                "*+json"
            };

            foreach (var contentType in contentTypes)
            {
                restClient.AddHandler(contentType, serializer);
            }
        }
Ejemplo n.º 2
0
 public static void AddNewtonsoftHandler(this IRestClient restClient, IRestRequest restRequest, NewtonsoftRestsharpJsonSerializer serializer)
 {
     restClient.AddNewtonsoftResponseHandler(serializer);
     restRequest.AddNewtonsoftRequestHandler(serializer);
 }
Ejemplo n.º 3
0
 public static void AddNewtonsoftRequestHandler(this IRestRequest restRequest, NewtonsoftRestsharpJsonSerializer serializer)
 {
     restRequest.RequestFormat  = DataFormat.Json;
     restRequest.JsonSerializer = serializer;
 }