Package net.oauth.http

Examples of net.oauth.http.HttpMessage


      requestHeaders.put(HttpMessage.CONTENT_TYPE, request.getContentType());
    } else {
      requestHeaders.put(HttpMessage.CONTENT_TYPE, provider.getContentType());
    }

    HttpMessage message = authScheme.getHttpMessage(provider,
        request.getRestMethod(), buildRestUrl(request), requestHeaders,
        buildRestPayload(request));

    HttpResponseMessage responseMessage = httpClient.execute(message);
View Full Code Here


    final String url = "http://example.org/test";
    final Map<String, String> headers = new HashMap<String, String>();

    FCAuthScheme authScheme = new FCAuthScheme(TOKEN);

    HttpMessage message = authScheme.getHttpMessage(new OrkutProvider(), "GET",
        url, headers, null);
    assertEquals(url + "?fcauth=" + TOKEN, message.url.toString());
  }
View Full Code Here

    final String url = "http://example.org/test";
    final Map<String, String> headers = new HashMap<String, String>();

    SecurityTokenScheme authScheme = new SecurityTokenScheme(TOKEN);

    HttpMessage message = authScheme.getHttpMessage(new OrkutProvider(), "GET",
        url, headers, null);
    assertEquals(url + "?st=" + TOKEN, message.url.toString());
  }
View Full Code Here

    /**
     * Send a request and return the response. Don't try to decide whether the
     * response indicates success; merely return it.
     */
    public OAuthResponseMessage access(OAuthMessage request, ParameterStyle style) throws IOException {
        HttpMessage httpRequest = HttpMessage.newRequest(request, style);
        HttpResponseMessage httpResponse = http.execute(httpRequest, httpParameters);
        httpResponse = HttpMessageDecoder.decode(httpResponse);
        return new OAuthResponseMessage(httpResponse);
    }
View Full Code Here

    /**
     * Send a request and return the response. Don't try to decide whether the
     * response indicates success; merely return it.
     */
    public OAuthResponseMessage access(OAuthMessage request,  net.oauth.ParameterStyle style) throws IOException {
        HttpMessage httpRequest = HttpMessage.newRequest(request, style);
        HttpResponseMessage httpResponse = http.execute(httpRequest, httpParameters);
        httpResponse = HttpMessageDecoder.decode(httpResponse);
        return new OAuthResponseMessage(httpResponse);
    }
View Full Code Here

      }
      if (!consumerDataObj.isUserAuthenticated()) {
        String url = createOAuthUrlString(
            json, consumerDataObj.getRpcServerUrl(), consumerDataObj.getAccessor());
        LOG.info("JSON request to be sent: " + json);
        HttpMessage request = new HttpMessage("POST", new URL(url), bodyStream);
        request.headers.add(
            new SimpleEntry<String, String>(HttpMessage.CONTENT_TYPE, JSON_MIME_TYPE));
        request.headers.add(new SimpleEntry<String, String>("oauth_version", "1.0"));
        responseStream =
            httpFetcher.execute(request, Collections.<String, Object>emptyMap()).getBody();
View Full Code Here

    /**
     * Send a request and return the response. Don't try to decide whether the
     * response indicates success; merely return it.
     */
    public OAuthResponseMessage access(OAuthMessage request,  net.oauth.ParameterStyle style) throws IOException {
        HttpMessage httpRequest = HttpMessage.newRequest(request, style);
        HttpResponseMessage httpResponse = http.execute(httpRequest, httpParameters);
        httpResponse = HttpMessageDecoder.decode(httpResponse);
        return new OAuthResponseMessage(httpResponse);
    }
View Full Code Here

TOP

Related Classes of net.oauth.http.HttpMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.