org.apache.http.client
Interface HttpClient

All Known Implementing Classes:
AbstractHttpClient, DefaultHttpClient

public interface HttpClient

Interface for an HTTP client. HTTP clients encapsulate a smorgasbord of objects required to execute HTTP requests while handling cookies, authentication, connection management, and other features. Thread safety of HTTP clients depends on the implementation and configuration of the specific client.

Since:
4.0
Version:
$Revision: 554231 $
Author:
Roland Weber

Method Summary
 org.apache.http.HttpResponse execute(HttpUriRequest request)
          Executes a request using the default context.
 org.apache.http.HttpResponse execute(HttpUriRequest request, org.apache.http.protocol.HttpContext context)
          Executes a request using the given context.
 org.apache.http.HttpResponse execute(RoutedRequest roureq)
          Executes a request along the given route using the default context.
 org.apache.http.HttpResponse execute(RoutedRequest roureq, org.apache.http.protocol.HttpContext context)
          Executes a request along the given route.
 ClientConnectionManager getConnectionManager()
          Obtains the connection manager used by this client.
 org.apache.http.protocol.HttpContext getDefaultContext()
          Obtains the default context used by this client populated with default attributes.
 org.apache.http.params.HttpParams getParams()
          Obtains the parameters for this client.
 

Method Detail

getDefaultContext

org.apache.http.protocol.HttpContext getDefaultContext()
Obtains the default context used by this client populated with default attributes. This context will be used by default when executing requests with this client.

Returns:
the default context

getParams

org.apache.http.params.HttpParams getParams()
Obtains the parameters for this client. These parameters will become defaults for all requests being executed with this client, and for the parameters of dependent objects in this client.

Returns:
the default parameters

getConnectionManager

ClientConnectionManager getConnectionManager()
Obtains the connection manager used by this client.

Returns:
the connection manager

execute

org.apache.http.HttpResponse execute(HttpUriRequest request)
                                     throws org.apache.http.HttpException,
                                            java.io.IOException
Executes a request using the default context. see there for details.

Parameters:
request - the request to execute
Returns:
the response to the request
Throws:
org.apache.http.HttpException - in case of a problem
java.io.IOException - in case of an IO problem
timeout exceptions?

execute

org.apache.http.HttpResponse execute(HttpUriRequest request,
                                     org.apache.http.protocol.HttpContext context)
                                     throws org.apache.http.HttpException,
                                            java.io.IOException
Executes a request using the given context. The route to the target will be determined by the HTTP client.

Parameters:
request - the request to execute
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:
org.apache.http.HttpException - in case of a problem
java.io.IOException - in case of an IO problem
timeout exceptions?

execute

org.apache.http.HttpResponse execute(RoutedRequest roureq,
                                     org.apache.http.protocol.HttpContext context)
                                     throws org.apache.http.HttpException,
                                            java.io.IOException
Executes a request along the given route.

Parameters:
roureq - the request to execute along with the route
context - the context to use for the execution, or null to use the default context
Returns:
the response to the request. See execute(HttpUriRequest,HttpContext) for details.
Throws:
org.apache.http.HttpException - in case of a problem
java.io.IOException - in case of an IO problem
timeout exceptions?

execute

org.apache.http.HttpResponse execute(RoutedRequest roureq)
                                     throws org.apache.http.HttpException,
                                            java.io.IOException
Executes a request along the given route using the default context.

Parameters:
roureq - the request to execute along with the route
Returns:
the response to the request. See execute(HttpUriRequest,HttpContext) for details.
Throws:
org.apache.http.HttpException - in case of a problem
java.io.IOException - in case of an IO problem
timeout exceptions?


Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.