Package org.scribe.model

Examples of org.scribe.model.OAuthRequest.addHeader()


        for (Header header : requestHeaders) {
            request.addHeader(header.getName(), header.getValue());
        }

        if (mediaType != null) {
            request.addHeader("Content-Type", mediaType);
        }

        oAuthService.signRequest(token, request);

        Response response = request.send();
View Full Code Here


    String url = props.getKeystoneHost() + ':' + props.getKeystonePort()
        + props.getKeystonePath() + accessToken;

    OAuthRequest oauthReq = new OAuthRequest(Verb.GET, url);
    oauthReq.addHeader(X_AUTH_HEADER, kmfAuthToken);

    return oauthReq.send();
  }

  private String obtainFilterToken() {
View Full Code Here

        System.out.println("********Get the profile in JSON********");
        //This basic call profile in JSON format
        //You can read more about JSON here http://json.org
        url = "http://api.linkedin.com/v1/people/~";
        request = new OAuthRequest(Verb.GET, url);
        request.addHeader("x-li-format", "json");
        service.signRequest(accessToken, request);
        response = request.send();
        System.out.println(response.getBody());
        System.out.println();System.out.println();

View Full Code Here

    {
      request.addBodyParameter(entry.getKey(), entry.getValue());
    }
    if (payload != null)
    {
      request.addHeader("Content-Length", Integer.toString(payload.length()));
      request.addHeader("Content-Type", "text/xml");
      request.addPayload(payload);
    }
    srv.signRequest(accessToken, request);
    return request;
View Full Code Here

      request.addBodyParameter(entry.getKey(), entry.getValue());
    }
    if (payload != null)
    {
      request.addHeader("Content-Length", Integer.toString(payload.length()));
      request.addHeader("Content-Type", "text/xml");
      request.addPayload(payload);
    }
    srv.signRequest(accessToken, request);
    return request;
  }
View Full Code Here

  }

  protected ResponseType get(String endPoint, Date modifiedAfter, Map<String,String> params) {
    OAuthRequest request = new OAuthRequest(Verb.GET, BASE_URL + endPoint);
    if (modifiedAfter != null) {
      request.addHeader("If-Modified-Since", utcFormatter.format(modifiedAfter));
    }
    if (params != null) {
      for (Map.Entry<String,String> param : params.entrySet()) {
        request.addQuerystringParameter(param.getKey(), param.getValue());
      }
View Full Code Here

    //request.addBodyParameter(OAuthConstants.CLIENT_SECRET, config.getApiSecret());
    request.addBodyParameter(OAuthConstants.CODE, verifier.getValue());
    request.addBodyParameter(OAuthConstants.REDIRECT_URI, config.getCallback());
    //Adding grant_type parameter manually
    //Hard-coded the values for now until scribe comes up with an update
    request.addHeader("Content-Type", "application/x-www-form-urlencoded");
    request.addBodyParameter("grant_type", "authorization_code");  
    if(config.hasScope()) request.addQuerystringParameter(OAuthConstants.SCOPE, config.getScope());   
    Response response = request.send();
    return api.getAccessTokenExtractor().extract(response.getBody());
  }
View Full Code Here

  }

  protected ResponseType get(String endPoint, Date modifiedAfter, Map<String,String> params) {
    OAuthRequest request = new OAuthRequest(Verb.GET, BASE_URL + endPoint);
    if (modifiedAfter != null) {
      request.addHeader("If-Modified-Since", utcFormatter.format(modifiedAfter));
    }
    if (params != null) {
      for (Map.Entry<String,String> param : params.entrySet()) {
        request.addQuerystringParameter(param.getKey(), param.getValue());
      }
View Full Code Here

    // Now let's go and ask for a protected resource!
    OAuthRequest request = new OAuthRequest(Verb.GET,
        Constants.PROTECTED_RESOURCE_URL_GOOGLE);
    service.signRequest(accessToken, request);
    request.addHeader("GData-Version", "3.0");
    Response response = request.send();

    readDataProfile(response.getBody());
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.