Skip to content

Commit dae4fe6

Browse files
committed
unify requests sending (async and sync variants). Allways use service::execute
1 parent c09bfce commit dae4fe6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+121
-147
lines changed

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/AWeberExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ public static void main(String... args) throws IOException {
5656

5757
// Now let's go and ask for a protected resource!
5858
System.out.println("Now we're going to access a protected resource...");
59-
final OAuthRequest request = new OAuthRequest(Verb.GET, ACCOUNT_RESOURCE_URL, service.getConfig());
59+
final OAuthRequest request = new OAuthRequest(Verb.GET, ACCOUNT_RESOURCE_URL);
6060
service.signRequest(accessToken, request);
61-
final Response response = request.send();
61+
final Response response = service.execute(request);
6262
System.out.println("Got it! Lets see what we found...");
6363
System.out.println();
6464
System.out.println(response.getBody());

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/Box20Example.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ public static void main(String... args) throws IOException {
7676

7777
// Now let's go and ask for a protected resource!
7878
System.out.println("Now we're going to access a protected resource...");
79-
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service.getConfig());
79+
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL);
8080
service.signRequest(accessToken, request);
81-
final Response response = request.send();
81+
final Response response = service.execute(request);
8282
System.out.println("Got it! Lets see what we found...");
8383
System.out.println();
8484
System.out.println(response.getCode());

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/DiggExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ public static void main(String... args) throws IOException {
5959

6060
// Now let's go and ask for a protected resource!
6161
System.out.println("Now we're going to access a protected resource...");
62-
final OAuthRequest request = new OAuthRequest(Verb.POST, PROTECTED_RESOURCE_URL, service.getConfig());
62+
final OAuthRequest request = new OAuthRequest(Verb.POST, PROTECTED_RESOURCE_URL);
6363
request.addBodyParameter("comment_id", "20100729223726:4fef610331ee46a3b5cbd740bf71313e");
6464
service.signRequest(accessToken, request);
65-
final Response response = request.send();
65+
final Response response = service.execute(request);
6666
System.out.println("Got it! Lets see what we found...");
6767
System.out.println();
6868
System.out.println(response.getCode());

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/FacebookExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ public static void main(String... args) throws IOException {
6969

7070
// Now let's go and ask for a protected resource!
7171
System.out.println("Now we're going to access a protected resource...");
72-
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service.getConfig());
72+
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL);
7373
service.signRequest(accessToken, request);
74-
final Response response = request.send();
74+
final Response response = service.execute(request);
7575
System.out.println("Got it! Lets see what we found...");
7676
System.out.println();
7777
System.out.println(response.getCode());

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/FlickrExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ public static void main(String... args) throws IOException {
5555

5656
// Now let's go and ask for a protected resource!
5757
System.out.println("Now we're going to access a protected resource...");
58-
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service.getConfig());
58+
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL);
5959
request.addQuerystringParameter("method", "flickr.test.login");
6060
service.signRequest(accessToken, request);
61-
final Response response = request.send();
61+
final Response response = service.execute(request);
6262
System.out.println("Got it! Lets see what we found...");
6363
System.out.println();
6464
System.out.println(response.getBody());

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/Foursquare2Example.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ public static void main(String... args) throws IOException {
5353

5454
// Now let's go and ask for a protected resource!
5555
System.out.println("Now we're going to access a protected resource...");
56-
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL + accessToken.getAccessToken(),
57-
service.getConfig());
56+
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL + accessToken.getAccessToken());
5857
service.signRequest(accessToken, request);
59-
final Response response = request.send();
58+
final Response response = service.execute(request);
6059
System.out.println("Got it! Lets see what we found...");
6160
System.out.println();
6261
System.out.println(response.getCode());

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/FoursquareExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public static void main(String... args) throws IOException {
5151

5252
// Now let's go and ask for a protected resource!
5353
System.out.println("Now we're going to access a protected resource...");
54-
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service.getConfig());
54+
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL);
5555
service.signRequest(accessToken, request);
56-
final Response response = request.send();
56+
final Response response = service.execute(request);
5757
System.out.println("Got it! Lets see what we found...");
5858
System.out.println();
5959
System.out.println(response.getBody());

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/FreelancerExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ public static void main(String... args) throws IOException {
5959

6060
// Now let's go and ask for a protected resource!
6161
System.out.println("Now we're going to access a protected resource...");
62-
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service.getConfig());
62+
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL);
6363
service.signRequest(accessToken, request);
6464
request.addHeader("GData-Version", "3.0");
65-
final Response response = request.send();
65+
final Response response = service.execute(request);
6666
System.out.println("Got it! Lets see what we found...");
6767
System.out.println();
6868
System.out.println(response.getCode());

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/GeniusExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ public static void main(String... args) throws IOException {
7575

7676
// Now let's go and ask for a protected resource!
7777
System.out.println("Accessing a protected resource...");
78-
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service.getConfig());
78+
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL);
7979
service.signRequest(accessToken, request);
80-
final Response response = request.send();
80+
final Response response = service.execute(request);
8181
System.out.println("Got it! Viewing contents...");
8282
System.out.println();
8383
System.out.println(response.getCode());

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/GitHubExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ public static void main(String... args) throws IOException {
6868

6969
// Now let's go and ask for a protected resource!
7070
System.out.println("Now we're going to access a protected resource...");
71-
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service.getConfig());
71+
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL);
7272
service.signRequest(accessToken, request);
73-
final Response response = request.send();
73+
final Response response = service.execute(request);
7474
System.out.println("Got it! Lets see what we found...");
7575
System.out.println();
7676
System.out.println(response.getCode());

0 commit comments

Comments
 (0)