Kanstantsin Shautsou
be081eec3f
Inject responce headers in GHObject and Exceptions.
...
GH has specific to GET/POST headers required for analysing in case of error.
Signed-off-by: Kanstantsin Shautsou <kanstantsin.sha@gmail.com >
2017-02-10 04:11:20 +03:00
Kohsuke Kawaguchi
6cad4a3c33
static import for conciseness
2017-01-09 16:43:03 -08:00
Kohsuke Kawaguchi
5b69a2925f
Merge pull request #324
2017-01-09 16:18:48 -08:00
Stephen Connolly
9d03435aa1
Expose Rate Limit Headers
...
Exposes the rate limit header responses so that consumers of the API can proactively tune their usage
2017-01-05 09:21:32 +00:00
Jesse Glick
ccb42d3249
[JENKINS-36240] Added GHRepository.getPermission(String).
2016-12-16 18:02:28 -05:00
David Xia
68ebc08c9d
Fix typos in javadocs
...
Replace "pagenated" with "paginated".
2016-11-26 00:44:52 -05:00
Kohsuke Kawaguchi
a1528a1a63
API to add/set/remove assignees from an issue
2016-11-19 14:48:43 -08:00
Kohsuke Kawaguchi
4f15b7c9fa
NPE fix. type can be null
2016-08-05 21:19:32 -07:00
Kohsuke Kawaguchi
a9fb4546e1
Constants for preview media types
2016-08-05 20:56:11 -07:00
Kohsuke Kawaguchi
856cf5e568
Better type safety by splitting RateLimitHandler and AbuseLimitHandler
...
While the signature is the same, headers that they expect are different,
so any non-trivial logic cannot be reused.
2016-08-05 19:58:04 -07:00
Matt Mitchell
9f5a6ee549
Implement an abuse handler
...
If too many requests are made within X amount of time (not the traditional hourly rate limit), github may begin returning 403. Then we should wait for a bit to attempt to access the API again. In this case, we parse out the Retry-After field returned and sleep until that (it's usually 60 seconds)
2016-07-22 13:16:12 -07:00
Kohsuke Kawaguchi
0415326d09
Issue #261 : handle 204 no content correctly
2016-06-03 20:27:29 -07:00
Kohsuke Kawaguchi
3d1bed0f8f
In JDK I'm using (Java8), I get a delegating HttpURLConnection that breaks the hack to set the method.
...
This change makes this hack even worse, but this is the only way I can think of, since I cannot update HttpURLConnection.methods that is static final.
2016-06-02 23:40:14 -07:00
Kohsuke Kawaguchi
5c9ea9b63a
Added a fluent version
2016-06-02 23:27:52 -07:00
Kohsuke Kawaguchi
557ae4165c
Not important
2016-03-18 19:19:51 -07:00
Kohsuke Kawaguchi
14dcb37ee1
Not all caller wants GET
2016-03-11 23:29:58 -08:00
Kohsuke Kawaguchi
bba07c9080
Merge pull request #253 from cyrille-leclerc/fix-infinite-loop
...
Fix #252 : infinite loop because the "hypertext engine" generates invalid URLs
2016-03-11 22:59:00 -08:00
Kohsuke Kawaguchi
dba84a33b9
Logger should be static
2016-03-11 22:55:58 -08:00
Cyrille Le Clerc
56379bb3b9
Fix broken log message in GitHub.java and cleanup code as recommended by @jglick
2016-03-07 19:25:42 +01:00
Cyrille Le Clerc
027e4b4f25
Better error message: introduce HttpException, subclass of IOException with url, http responseCode and http responseMessage to help exception handling.
2016-03-06 18:34:27 +01:00
Cyrille Le Clerc
ba951cb6e3
Fix #252 : infinite loop because the "hypertext engine" may duplicate '?' generating invalid " https://api.github.com/notifications?all=true&page=2?all=true " instead of " https://api.github.com/notifications?all=true&page=2&all=true ". A better fix will be to prevent duplication of parameters ("all=true" in this case).
2016-03-06 18:27:05 +01:00
Kohsuke Kawaguchi
dbc79f8c42
Fixing issue raised in https://github.com/kohsuke/github-api/pull/247
...
From Shredder121,
--------------------
Only the HttpURLConnection.method was set by that change. Not the
Requester.method.
This means that Requester.method is still set to POST, isMethodWithBody
will return true, and uc.setDoOutput(true) will be called.
I use Okhttp, and their HttpURLConnectionImpl's method changes to POST
if you tell it to open a stream to write to.
2016-03-01 19:46:50 -08:00
Kohsuke Kawaguchi
2440a676bd
Added more comprehensive API to list pull requests
...
This fixes issue #234
2015-12-10 06:26:04 -08:00
Kohsuke Kawaguchi
dbddf5b9eb
Implemented pagenation size support.
2015-12-03 17:41:43 +01:00
Kohsuke Kawaguchi
841f77bac2
Naming anonymous iterator.
...
... in anticipation of the page size support.
2015-12-03 16:33:39 +01:00
Kohsuke Kawaguchi
83ffe75baa
Fixed rate handling limit handling
...
Issue #220 . If RateLimitHandler returns normally, it should retry.
2015-12-02 12:03:39 +01:00
Kohsuke Kawaguchi
75a4081549
Follow up to PR #216
2015-12-01 14:57:30 +01:00
Kohsuke Kawaguchi
f9291f9fd1
Merge pull request #216 from if6was9/issue-215-download-failure
...
#215 fix read() failure with private repos
2015-12-01 14:56:49 +01:00
Ruben Dijkstra
5dc83cf2bf
Overzealous FindBugs changes.
...
Charsets that are standard on the JRE are try-lookuped,
bridge methods were removed and a stream that would be closed later is closed explicitly
2015-10-08 19:31:55 +02:00
Rob Schoening
e0b109cba6
fix read() failure with private repos
...
reorder buildRequest()
2015-09-06 08:28:20 -07:00
Oleg Nenashev
79c5b2edd5
FindBugs: Fix over 100 issues and enforce FindBugs
2015-07-20 12:28:41 +03:00
MerkushevKirill
931ed7adac
don't ignore args when method without body
...
in case of GET or DELETE request
2015-06-15 18:14:58 +03:00
MerkushevKirill
861fd55d06
fix for unused json map when method with body, but body is null
...
fixes regression from b976e0ef4e
2015-06-15 17:57:16 +03:00
Kohsuke Kawaguchi
b976e0ef4e
Issue #180 : don't write body if HTTP method is DELETE.
2015-04-26 10:52:43 -07:00
Kanstantsin Shautsou
d0d0716b3b
Throw error for bad creds
2015-03-23 02:09:23 +03:00
Kohsuke Kawaguchi
adba2e68db
Renamed for consistency with other methods
2015-03-22 15:54:53 -07:00
Kohsuke Kawaguchi
74fda40764
Implemented initial notification API support.
...
Fixes issue #119
2015-03-22 15:40:53 -07:00
Kohsuke Kawaguchi
687a36937e
Keep HttpURLConnection() in the field.
...
The primary motivation was to expose response headers, but this also made the code most concise by reducing the # of parameters that are passed around.
2015-03-22 14:52:34 -07:00
Kohsuke Kawaguchi
2c7b8bd6e8
report error stream even for 404
2015-03-22 14:46:38 -07:00
Kohsuke Kawaguchi
5bf252e12d
Added markdown support
...
Fixes issue #165
2015-03-22 11:00:57 -07:00
Kohsuke Kawaguchi
5a8845f7f6
added a method to return the raw unprocessed body
2015-03-22 09:17:49 -07:00
Kohsuke Kawaguchi
77590b4eb3
eliminate the need for path manipulation and consolidate them to 'with'
2015-03-21 16:52:49 -07:00
Kohsuke Kawaguchi
72fc313135
improved error handling
2015-03-21 16:43:11 -07:00
Kohsuke Kawaguchi
4093e53b5b
Implemented a strategy pattern to let the client determine API rate limit behavior.
...
The default is set to the backward compatible behaviour.
2015-03-17 07:43:51 -07:00
Kohsuke Kawaguchi
4b6981c2e7
Added issue-search capability
2015-02-14 09:53:29 -08:00
t865095
b9764c0a44
introduce pagination for all paged api calls and introduce cache invalidation
2014-07-08 13:52:53 +02:00
Kohsuke Kawaguchi
c784ab6632
Added Gist support
2014-05-10 13:52:36 -07:00
Kohsuke Kawaguchi
a409b4f49c
Merge branch 'pull-86'
...
Conflicts:
src/main/java/org/kohsuke/github/GHOrganization.java
src/main/java/org/kohsuke/github/Requester.java
src/test/java/org/kohsuke/AppTest.java
2014-05-09 18:30:59 -07:00
Kohsuke Kawaguchi
926776204b
Implemented the builder pattern to my liking
2014-05-09 18:28:34 -07:00
Kohsuke Kawaguchi
a18cde2340
Abstracted away HTTP connector and added OkHttp implementation for convenience
2014-04-13 08:46:21 -07:00