/// <summary>
        /// Create a new Twilio request
        /// </summary>
        /// <param name="method">HTTP method</param>
        /// <param name="uri">Request URI</param>
        /// <param name="region">Twilio region</param>
        /// <param name="queryParams">Query parameters</param>
        /// <param name="postParams">Post data</param>
        public Request(
            HttpMethod method,
            SubscriptionKey subscriptionKey,
            Domain uri,
            string postParams,
            string queryParam = null
            )
        {
            Method          = method;
            SubscriptionKey = subscriptionKey;
            QueryParam      = queryParam ?? string.Empty;
            PostParams      = postParams ?? string.Empty;

            Uri = ConstructUrl(new Uri("https://apidata.guidestar.org/" + uri), QueryParam);
        }
 public RestClient(SubscriptionKey subscriptionKey)
 {
     _subscriptionKey = subscriptionKey;
     HttpClient       = DefaultClient();
 }
示例#3
0
 /// <summary>
 /// Get the rest client
 /// </summary>
 /// <returns>The rest client</returns>
 public static RestClient GetRestClient(SubscriptionKey subscriptionKey = null)
 {
     return(new RestClient(subscriptionKey ?? _defaultSubscriptionKey));
 }
示例#4
0
 /// <summary>
 /// Initializes GuideStarClient with default subscription key
 /// Recommended use is to set all subscription keys with GuideStarClient.SubscriptionKeys.Add()
 /// </summary>
 /// <param name="defaultSubscriptionKey">Your API subscription key</param>
 public static void SetDefaultSubscriptionKey(string defaultSubscriptionKey)
 {
     _defaultSubscriptionKey = new SubscriptionKey(defaultSubscriptionKey);
 }