예제 #1
0
        private NameValueCollection OAuthQuery(OAuthRequest oAuthRequest)
        {
            var auth    = oAuthRequest.GetAuthorizationHeader();
            var request = new Common.Http.HttpRequest(oAuthRequest.RequestUrl);

            request.Headers.Add("Authorization", auth);
            var response = _httpClient.Get(request);

            return(HttpUtility.ParseQueryString(response.Content));
        }
예제 #2
0
        private string GetAuthorizationHeader(OAuthRequest oAuthRequest)
        {
            var request = new Common.Http.HttpRequest(Settings.SigningUrl)
            {
                Method = HttpMethod.Post,
            };

            request.Headers.Set("Content-Type", "application/json");

            var payload = oAuthRequest.ToJson();

            _logger.Trace(payload);
            request.SetContent(payload);

            var response = _httpClient.Post <AuthorizationHeader>(request).Resource;

            return(response.Authorization);
        }
예제 #3
-1
        private NameValueCollection OAuthQuery(OAuthRequest oAuthRequest)
        {
            var auth = oAuthRequest.GetAuthorizationHeader();
            var request = new Common.Http.HttpRequest(oAuthRequest.RequestUrl);
            request.Headers.Add("Authorization", auth);
            var response = _httpClient.Get(request);

            return HttpUtility.ParseQueryString(response.Content);
        }