Clean up request method calls

This commit is contained in:
Liam Newman
2019-12-16 11:18:56 -08:00
parent 0f9482864c
commit 40f05e4dbb
28 changed files with 66 additions and 107 deletions

View File

@@ -102,7 +102,6 @@ public class GHNotificationStream implements Iterable<GHThread> {
public Iterator<GHThread> iterator() {
// capture the configuration setting here
final Requester req = root.retrieve()
.method("GET")
.with("all", all)
.with("participating", participating)
.with("since", since);
@@ -233,10 +232,10 @@ public class GHNotificationStream implements Iterable<GHThread> {
* the io exception
*/
public void markAsRead(long timestamp) throws IOException {
final Requester req = root.retrieve().method("PUT");
final Requester req = root.retrieve();
if (timestamp >= 0)
req.with("last_read_at", GitHub.printDate(new Date(timestamp)));
req.asHttpStatusCode(apiUrl);
req.withUrlPath(apiUrl).asHttpStatusCode();
}
private static final GHThread[] EMPTY_ARRAY = new GHThread[0];