Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5a8845f

Browse filesBrowse files
committed
added a method to return the raw unprocessed body
1 parent 709e47f commit 5a8845f
Copy full SHA for 5a8845f

File tree

Expand file treeCollapse file tree

1 file changed

+14
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-3
lines changed
Open diff view settings
Collapse file

‎src/main/java/org/kohsuke/github/Requester.java‎

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/Requester.java
+14-3Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import java.io.IOException;
3030
import java.io.InputStream;
3131
import java.io.InputStreamReader;
32-
import java.io.InterruptedIOException;
3332
import java.io.Reader;
3433
import java.io.UnsupportedEncodingException;
3534
import java.lang.reflect.Array;
@@ -55,8 +54,6 @@
5554
import com.fasterxml.jackson.databind.JsonMappingException;
5655
import org.apache.commons.io.IOUtils;
5756

58-
import javax.net.ssl.HttpsURLConnection;
59-
6057
/**
6158
* A builder pattern for making HTTP call and parsing its output.
6259
*
@@ -247,6 +244,20 @@ public int asHttpStatusCode(String tailApiUrl) throws IOException {
247244
}
248245
}
249246

247+
public InputStream read(String tailApiUrl) throws IOException {
248+
while (true) {// loop while API rate limit is hit
249+
HttpURLConnection uc = setupConnection(root.getApiURL(tailApiUrl));
250+
251+
buildRequest(uc);
252+
253+
try {
254+
return uc.getInputStream();
255+
} catch (IOException e) {
256+
handleApiError(e,uc);
257+
}
258+
}
259+
}
260+
250261
private void buildRequest(HttpURLConnection uc) throws IOException {
251262
if (!method.equals("GET")) {
252263
uc.setDoOutput(true);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.