Guest User

Untitled

a guest
May 15th, 2012
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. Removing oauth_token from request header in Scribe
  2. public class TestImporter {
  3.  
  4. private static final String REQ_URL = "http://test.com/";
  5.  
  6. private static final String KEY = "KEY";
  7. private static final String SECRET = "SECRET";
  8.  
  9. // test variables
  10. private static final String VAR1 = "Test123";
  11.  
  12. public static void main(String[] args) {
  13.  
  14. OAuthService service = new ServiceBuilder()
  15. .provider(TestAPI.class)
  16. .apiKey(KEY)
  17. .apiSecret(SECRET)
  18. .build();
  19. Token token = new Token("", "");
  20. OAuthRequest request = new OAuthRequest(Verb.GET, REQ_URL + VAR1 + "/");
  21. service.signRequest(token, request);
  22. Response response = request.send();
  23. System.out.println(response.getBody());
  24.  
  25. }
  26.  
  27. }
  28.  
  29. ServiceBuilder()
  30. .provider(TestAPI.class)
  31. .apiKey(KEY)
  32. .apiSecret(SECRET)
  33. .signatureType(SignatureType.QueryString)
  34. .build();
Advertisement
Add Comment
Please, Sign In to add comment