1
0
Fork 0

Merge pull request #2 from chaplinkyle/master

Expose httpclient for proxy configuration.
master
Bob Carroll 2013-08-21 15:41:11 -07:00
commit ebe661b70e
1 changed files with 12 additions and 3 deletions

View File

@ -50,7 +50,7 @@ import net.sf.json.JSONSerializer;
*/
public class RestClient {
private HttpClient httpclient = null;
private HttpClient httpClient = null;
private ICredentials creds = null;
private URI uri = null;
@ -72,7 +72,7 @@ public class RestClient {
* @param uri Base URI of the remote REST service
*/
public RestClient(HttpClient httpclient, ICredentials creds, URI uri) {
this.httpclient = httpclient;
this.httpClient = httpclient;
this.creds = creds;
this.uri = uri;
}
@ -118,7 +118,7 @@ public class RestClient {
if (creds != null)
creds.authenticate(req);
HttpResponse resp = httpclient.execute(req);
HttpResponse resp = httpClient.execute(req);
HttpEntity ent = resp.getEntity();
StringBuilder result = new StringBuilder();
@ -312,5 +312,14 @@ public class RestClient {
return put(buildURI(path), payload);
}
/**
* Exposes the http client.
*
* @return the httpClient property
*/
public HttpClient getHttpClient(){
return this.httpClient;
}
}