Package org.apache.shindig.gadgets.oauth

Examples of org.apache.shindig.gadgets.oauth.OAuthFetcher


   * Send an OAuth GET request to the given URL.
   */
  public HttpResponse sendGet(String target) throws Exception {
    HttpRequest request = new HttpRequest(Uri.parse(target));
    request.setOAuthArguments(recallState());
    OAuthFetcher dest = new OAuthFetcher(fetcherConfig, serviceProvider, request);
    request.setIgnoreCache(ignoreCache);
    request.setSecurityToken(securityToken);
    HttpResponse response = dest.fetch(request);
    saveState(response);
    return response;
  }
View Full Code Here


   * Send an OAuth POST request to the given URL.
   */
  public HttpResponse sendFormPost(String target, String body) throws Exception {
    HttpRequest request = new HttpRequest(Uri.parse(target));
    request.setOAuthArguments(recallState());
    OAuthFetcher dest = new OAuthFetcher(fetcherConfig, serviceProvider, request);
    request.setMethod("POST");
    request.setPostBody(CharsetUtil.getUtf8Bytes(body));
    request.setHeader("content-type", "application/x-www-form-urlencoded");
    request.setSecurityToken(securityToken);
    HttpResponse response = dest.fetch(request);
    saveState(response);
    return response;
  }
View Full Code Here

   * Send an OAuth POST with binary data in the binary.
   */
  public HttpResponse sendRawPost(String target, String type, byte[] body) throws Exception {
    HttpRequest request = new HttpRequest(Uri.parse(target));
    request.setOAuthArguments(recallState());
    OAuthFetcher dest = new OAuthFetcher(fetcherConfig, serviceProvider, request);
    request.setMethod("POST");
    if (type != null) {
      request.setHeader("Content-Type", type);
    }
    request.setPostBody(body);
    request.setSecurityToken(securityToken);
    HttpResponse response = dest.fetch(request);
    saveState(response);
    return response;
  }
View Full Code Here

TOP

Related Classes of org.apache.shindig.gadgets.oauth.OAuthFetcher

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.