Package org.apache.juneau.rest.client
Class BasicRestCallHandler
java.lang.Object
org.apache.juneau.rest.client.BasicRestCallHandler
- All Implemented Interfaces:
RestCallHandler
Default HTTP call handler.
Can be subclasses and specified via
RestClient.Builder.callHandler()
.
See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionrun
(HttpHost target, HttpRequest request, HttpContext context) Execute the specified request.
-
Constructor Details
-
BasicRestCallHandler
Constructor.- Parameters:
client
- The client to use for handling requests.
-
-
Method Details
-
run
public HttpResponse run(HttpHost target, HttpRequest request, HttpContext context) throws IOException Description copied from interface:RestCallHandler
Execute the specified request.Subclasses can override this method to provide specialized handling.
- Specified by:
run
in interfaceRestCallHandler
- Parameters:
target
- The target host for the request.
Implementations may acceptnull if they can still determine a route, for example to a default target or by inspecting the request.request
- The request to execute. Must be an instance ofHttpUriRequest
if the target isnull .context
- The context to use for the execution, ornull to use the default context.- Returns:
- The response to the request.
This is always a final response, never an intermediate response with an 1xx status code.
Whether redirects or authentication challenges will be returned or handled automatically depends on the implementation and configuration of this client. - Throws:
IOException
- In case of a problem or the connection was aborted.ClientProtocolException
- In case of an http protocol error.
-