Example #1
0
 /// <summary>
 /// Default constructor. Initialize rest Parameters and sets Auto Redirect to true.
 /// </summary>
 public RestfulCall()
 {
     HeaderParams = new Dictionary<string, string>();
     QueryParams = new Dictionary<string, string>();
     // Add default header parameters
     AddHeader("Accept", "application/json");
     AddHeader("Content-Type", "application/json");
     //Adds restricted headers which needs to exclude for signature generation
     restrictedHeaderActions = new Dictionary<string, Action<HttpWebRequest, string>>(StringComparer.OrdinalIgnoreCase);
     restrictedHeaderActions.Add("Accept", (r, v) => r.Accept = v);
     restrictedHeaderActions.Add("Content-Type", (r, v) => r.ContentType = v);
     //By default allow auto redirects
     AllowAutoRedirect = true;
     APITransmitter = new RestfulTransmitter();
 }
Example #2
0
 /// <summary>
 /// Calls base constructor and sets Resource and Method properties
 /// </summary>
 public RestfulCall(string baseUrl, string resource, Method method)
     : this()
 {
     Resource = resource;
     Method = method;
     BaseUrl = baseUrl;
     APITransmitter = new RestfulTransmitter();
 }