Esempio n. 1
0
 private TwitterReverseGeocodeResponse(SocialHttpResponse response) : base(response)
 {
 }
 /// <summary>
 /// Parses the specified <paramref name="response"/> into an instance of <see cref="FacebookGetPageResponse"/>.
 /// </summary>
 /// <param name="response">The instance of <see cref="SocialHttpResponse"/> representing the raw response.</param>
 /// <returns>An instance of <see cref="FacebookGetPageResponse"/> representing the response.</returns>
 public static FacebookGetPageResponse ParseResponse(SocialHttpResponse response)
 {
     return(response == null ? null : new FacebookGetPageResponse(response));
 }
 /// <summary>
 /// Initializes a new instance from the specified <code>response</code> and <code>body</code>.
 /// </summary>
 /// <param name="response">The raw response.</param>
 /// <param name="body">The object representing the response body.</param>
 /// <returns>Returns an instance of <see cref="OAuthAccessTokenResponse"/>.</returns>
 public static OAuthAccessTokenResponse ParseResponse(SocialHttpResponse response, OAuthAccessToken body)
 {
     return(response == null ? null : new OAuthAccessTokenResponse(response, body));
 }
 /// <summary>
 /// Parses the specified <paramref name="response"/> into an instance of <see cref="BitBucketGetBranchResponse"/>.
 /// </summary>
 /// <param name="response">The instance of <see cref="SocialHttpResponse"/> representing the raw response.</param>
 /// <returns>An instance of <see cref="BitBucketGetBranchResponse"/> representing the response.</returns>
 public static BitBucketGetBranchResponse ParseResponse(SocialHttpResponse response)
 {
     return(response == null ? null : new BitBucketGetBranchResponse(response));
 }
 /// <summary>
 /// Parses the specified <paramref name="response"/> into an instance of <see cref="VimeoGetVideoResponse"/>.
 /// </summary>
 /// <param name="response">The instance of <see cref="SocialHttpResponse"/> representing the raw response.</param>
 /// <returns>An instance of <see cref="VimeoGetVideoResponse"/> representing the response.</returns>
 public static VimeoGetVideoResponse ParseResponse(SocialHttpResponse response)
 {
     return(response == null ? null : new VimeoGetVideoResponse(response));
 }
 /// <summary>
 /// Initializes a new instance based on the specified <paramref name="response"/>.
 /// </summary>
 /// <param name="response">The raw response.</param>
 protected SonosResponse(SocialHttpResponse response) : base(response)
 {
     Headers = new SonosResponseHeaders(response);
 }
Esempio n. 7
0
 private FacebookPhotoResponse(SocialHttpResponse response) : base(response)
 {
 }
Esempio n. 8
0
 private FacebookDebugTokenResponse(SocialHttpResponse response) : base(response)
 {
 }
 private GitHubRepositoryResponse(SocialHttpResponse response) : base(response)
 {
 }
Esempio n. 10
0
 public static BitBucketRepositoriesResponse ParseResponse(SocialHttpResponse response)
 {
     return(response == null ? null : new BitBucketRepositoriesResponse(response));
 }
 /// <summary>
 /// Initializes a new exception based on the specified <paramref name="response"/> and <paramref name="meta"/> data.
 /// </summary>
 /// <param name="response">The response the exception should be based on.</param>
 /// <param name="meta">The meta data with information about the exception.</param>
 public InstagramOAuthForbiddenException(SocialHttpResponse response, InstagramMetaData meta) : base(response, meta)
 {
 }
 /// <summary>
 /// Initializes a new instance based on the specified <paramref name="response"/>.
 /// </summary>
 /// <param name="response">The instance of <see cref="SocialHttpResponse"/> representing the raw response.</param>
 protected FacebookResponse(SocialHttpResponse response) : base(response)
 {
 }
Esempio n. 13
0
 /// <summary>
 /// Parses the specified <paramref name="response"/> into an instance of <see cref="FacebookCreatePostResponse"/>.
 /// </summary>
 /// <param name="response">The instance of <see cref="SocialHttpResponse"/> representing the raw response.</param>
 /// <returns>An instance of <see cref="FacebookCreatePostResponse"/> representing the response.</returns>
 public static FacebookCreatePostResponse ParseResponse(SocialHttpResponse response)
 {
     return(response == null ? null : new FacebookCreatePostResponse(response));
 }
Esempio n. 14
0
 public AddCommentResult(SocialHttpResponse response)
 {
     Response = response;
     Success  = response.StatusCode == HttpStatusCode.Created;
 }
Esempio n. 15
0
 private TwitterUserListResponse(SocialHttpResponse response) : base(response)
 {
 }
 /// <summary>
 /// Initializes a new instance based on the specified <code>response</code> and <code>message</code>.
 /// </summary>
 /// <param name="response">The underlying response.</param>
 /// <param name="message">The message.</param>
 public OAuthException(SocialHttpResponse response, string message) : base(message)
 {
     Response = response;
 }
Esempio n. 17
0
 private TwitterPlaceResponse(SocialHttpResponse response) : base(response)
 {
 }
Esempio n. 18
0
 internal InstagramNotFoundException(SocialHttpResponse response, InstagramMetaData meta) : base(response, meta)
 {
 }
Esempio n. 19
0
 public static BitBucketCommitsResponse ParseResponse(SocialHttpResponse response)
 {
     return(response == null ? null : new BitBucketCommitsResponse(response));
 }
Esempio n. 20
0
 internal InstagramNotFoundException(SocialHttpResponse response) : base(response)
 {
 }
Esempio n. 21
0
 protected TwitterResponse(SocialHttpResponse response)
 {
     Response = response;
 }
 private GitHubCommitResponse(SocialHttpResponse response) : base(response)
 {
 }
Esempio n. 23
0
 private FacebookLinkResponse(SocialHttpResponse response) : base(response)
 {
 }
Esempio n. 24
0
        /// <summary>
        /// Makes a signed request to the underlying API based on the specified parameters.
        /// </summary>
        /// <param name="method">The HTTP method of the request.</param>
        /// <param name="url">The base URL of the request (no query string).</param>
        /// <param name="queryString">The query string.</param>
        /// <param name="postData">The POST data.</param>
        /// <returns>Returns an instance of <see cref="SocialHttpResponse"/> representing the raw response.</returns>
        public virtual SocialHttpResponse DoHttpRequest(string method, string url, NameValueCollection queryString, NameValueCollection postData)
        {
            // Check if NULL
            if (queryString == null)
            {
                queryString = new NameValueCollection();
            }
            if (postData == null)
            {
                postData = new NameValueCollection();
            }

            // Merge the query string
            if (queryString.Count > 0)
            {
                UriBuilder builder = new UriBuilder(url);
                url += (url.Contains("?") ? "&" : "") + builder.MergeQueryString(queryString).Query;
            }

            // Initialize the request
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);

            // Generate the signature
            string signature = GenerateSignature(method, url, queryString, postData);

            // Generate the header
            string header = GenerateHeaderString(signature);

            // Add the authorization header
            request.Headers.Add("Authorization", header);

            // Set the method
            request.Method = method;

            // Add the request body (if a POST request)
            if (method == "POST" && postData.Count > 0)
            {
                string dataString = SocialUtils.Misc.NameValueCollectionToQueryString(postData);
                //throw new Exception(dataString);
                request.ContentType   = "application/x-www-form-urlencoded";
                request.ContentLength = dataString.Length;
                using (Stream stream = request.GetRequestStream()) {
                    stream.Write(Encoding.UTF8.GetBytes(dataString), 0, dataString.Length);
                }
            }

            // Make sure we reset the client (timestamp and nonce)
            if (AutoReset)
            {
                Reset();
            }

            // Get the response
            try {
                return(SocialHttpResponse.GetFromWebResponse((HttpWebResponse)request.GetResponse()));
            } catch (WebException ex) {
                if (ex.Status != WebExceptionStatus.ProtocolError)
                {
                    throw;
                }
                return(SocialHttpResponse.GetFromWebResponse((HttpWebResponse)ex.Response));
            }
        }
 protected TwitterResponse(SocialHttpResponse response) : base(response)
 {
     RateLimiting = TwitterRateLimiting.GetFromResponse(response);
 }
 /// <summary>
 /// Parses the specified <paramref name="response"/> into an instance of <see cref="SpotifyGetAudioAnalysisResponse"/>.
 /// </summary>
 /// <param name="response">The response to be parsed.</param>
 /// <returns>An instance of <see cref="SpotifyGetAudioAnalysisResponse"/>.</returns>
 public static SpotifyGetAudioAnalysisResponse ParseResponse(SocialHttpResponse response)
 {
     return(response == null ? null : new SpotifyGetAudioAnalysisResponse(response));
 }
Esempio n. 27
0
 private InstagramLocationResponse(SocialHttpResponse response) : base(response)
 {
 }
 /// <summary>
 /// Initializes a new instance from the specified <code>response</code> and <code>body</code>.
 /// </summary>
 /// <param name="response">The raw response.</param>
 /// <param name="body">The object representing the response body.</param>
 protected OAuthAccessTokenResponse(SocialHttpResponse response, OAuthAccessToken body) : base(response)
 {
     Body = body;
 }