Class BasicRestCallHandler

java.lang.Object
org.apache.juneau.rest.client.BasicRestCallHandler
All Implemented Interfaces:
RestCallHandler

public class BasicRestCallHandler extends Object implements RestCallHandler
Default HTTP call handler. Can be subclasses and specified via RestClient.Builder.callHandler().
See Also:
  • Constructor Details

  • 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 interface RestCallHandler
      Parameters:
      target - The target host for the request.
      Implementations may accept null 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 of HttpUriRequest if the target is null.
      context - The context to use for the execution, or null 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.