Package org.scribe.oauth

Examples of org.scribe.oauth.OAuthService.signRequest()


        System.out.println("********A basic user profile call and response dissected********");
        //This sample is mostly to help you debug and understand some of the scaffolding around the request-response cycle
        //https://developer.linkedin.com/documents/debugging-api-calls
        url = "https://api.linkedin.com/v1/people/~";
        request = new OAuthRequest(Verb.GET, url);
        service.signRequest(accessToken, request);
        response = request.send();
        //get all the headers
        System.out.println("Request headers: " + request.getHeaders().toString());
        System.out.println("Response headers: " + response.getHeaders().toString());
        //url requested
View Full Code Here


        // Now demonstrate how to make a logging function which provides us the info we need to
        // properly help debug issues. Please use the logged block from here when requesting
        // help in the forums.
        url = "https://api.linkedin.com/v1/people/FOOBARBAZ";
        request = new OAuthRequest(Verb.GET, url);
        service.signRequest(accessToken, request);
        response = request.send();

        responseNumber = response.getCode();

        if(responseNumber < 200 || responseNumber >= 300){
View Full Code Here

      System.out.println();

      // Now let's go and ask for a protected resource!
      System.out.println("Now we're going to access a protected resource...");
      OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL);
      service.signRequest(accessToken, request);
      Response response = request.send();
      System.out.println("Got it! Lets see what we found...");
      System.out.println();
      System.out.println(response.getBody());
View Full Code Here

        request.addQuerystringParameter("location", city);
        //request.addQuerystringParameter("category", "restaurants");
        request.addQuerystringParameter("term", searchTerm);
        request.addQuerystringParameter("limit", "20");

        service.signRequest(accessToken, request);
        Response response = request.send();
        String rawData = response.getBody();

        YelpSearchResults mYelpSearchResult = null;
View Full Code Here

    Token accessToken = service.getAccessToken(requestToken, verifier);

    // 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

        verifier);

    // Now let's go and ask for a protected resource!
    OAuthRequest request = new OAuthRequest(Verb.GET,
        Constants.PROTECTED_RESOURCE_URL_FACEBOOK);
    service.signRequest(accessToken, request);
    Response response = request.send();
    readDataProfile(StringEscapeUtils.unescapeJava(response.getBody()));
  }

  private void readDataProfile(String body) {
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.