org.codegist.crest
Class HttpClientRestService
java.lang.Object
org.codegist.crest.HttpClientRestService
- All Implemented Interfaces:
- Disposable, RestService
public class HttpClientRestService
- extends Object
- implements RestService, Disposable
RestService implementation based on ASF HttpClient
.
This implementation is preferable to the default one DefaultRestService
.
- Author:
- Laurent Gilles (laurent.gilles@codegist.org)
- See Also:
HttpClient
HttpClientRestService
public HttpClientRestService()
- Construct a HttpClientRestService based on
DefaultHttpClient.DefaultHttpClient()
.
HttpClientRestService
public HttpClientRestService(HttpClient http)
exec
public HttpResponse exec(HttpRequest httpRequest)
throws HttpException
- Description copied from interface:
RestService
- Execute the given request.
- Specified by:
exec
in interface RestService
- Parameters:
httpRequest
- Request to fire
- Returns:
- The response.
- Throws:
HttpException
- For any problem occuring during the http transaction, and when response status code is not HTTP OK 200
newRestService
public static RestService newRestService(int maxConcurrentConnection,
int maxConnectionPerRoute)
dispose
public void dispose()
- Specified by:
dispose
in interface Disposable
Copyright © 2011. All Rights Reserved.