Skip to content

Commit

Permalink
allow changing default RestClient
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Emmerich committed May 10, 2018
1 parent 5230533 commit 043ade5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/io/joshworks/restclient/http/Unirest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ private synchronized static RestClient getClient() {
}
return client;
}

public synchronized static void setClient(RestClient client) {
close();
Unirest.client = client;
}

public synchronized static void close() {
if (client != null) {
Expand Down

0 comments on commit 043ade5

Please sign in to comment.