|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HttpClientConnection
An HTTP connection for use on the client side. It is used for sending requests and receiving responses. TODO add local port
Method Summary | |
---|---|
void |
flush()
Writes out all pending buffered data over the open connection. |
java.net.InetAddress |
getLocalAddress()
The local address the connection is or will be bound to as set by |
HttpHost |
getTargetHost()
Returns the current target host as set by @link #setTargetHost(HttpHost). |
boolean |
isResponseAvailable(int timeout)
Checks if response data is available from the connection. |
void |
open(HttpParams params)
Opens the connection. |
void |
receiveResponseEntity(HttpResponse response)
Receives the next response entity available from this connection and attaches it to an existing HttpResponse object. |
HttpResponse |
receiveResponseHeader(HttpParams params)
Receives the request line and headers of the next response available from this connection. |
void |
sendRequestEntity(HttpEntityEnclosingRequest request)
Sends the request entity over the connection. |
void |
sendRequestHeader(HttpRequest request)
Sends the request line and all headers over the connection. |
void |
setLocalAddress(java.net.InetAddress localAddress)
Sets the local address the connection will be bound to upon opening. |
void |
setTargetHost(HttpHost targethost)
Provides the implementation with the host it is supposed to connect to. |
Methods inherited from interface org.apache.http.HttpConnection |
---|
close, isOpen, isStale, shutdown |
Method Detail |
---|
HttpHost getTargetHost()
void setTargetHost(HttpHost targethost)
targethost
- the host to connect tojava.net.InetAddress getLocalAddress()
void setLocalAddress(java.net.InetAddress localAddress)
localAddress
- the local bind address or null
.void open(HttpParams params) throws java.io.IOException
params
- the parameters in effect for this connection.
java.io.IOException
boolean isResponseAvailable(int timeout) throws java.io.IOException
timeout
- the maximum time in milliseconds to wait for data
timeout
milliseconds.
java.io.IOException
- if an error happens on the connectionvoid sendRequestHeader(HttpRequest request) throws HttpException, java.io.IOException
request
- the request whose headers to send.
HttpException
java.io.IOException
void sendRequestEntity(HttpEntityEnclosingRequest request) throws HttpException, java.io.IOException
request
- the request whose entity to send.
HttpException
java.io.IOException
HttpResponse receiveResponseHeader(HttpParams params) throws HttpException, java.io.IOException
params
- the parameters in effect
HttpException
java.io.IOException
void receiveResponseEntity(HttpResponse response) throws HttpException, java.io.IOException
response
- the response to attach the entity to
HttpException
java.io.IOException
void flush() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |