|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.httpclient.HttpClient
An HTTP "user-agent", containing an HttpState
and
one or more HttpConnection
s, to which
HttpMethod
s can be applied.
Constructor Summary | |
HttpClient()
Constructor. |
Method Summary | |
void |
endSession()
End the current session, closing my the associated connection if any. |
int |
executeMethod(HttpMethod method)
Execute the given HttpMethod using my current
connection and HttpState . |
HttpState |
getState()
Get my state . |
void |
setState(HttpState state)
Set my state . |
void |
startSession(java.lang.String host,
int port)
Start an HTTP session with the server at the given host and port. |
void |
startSession(java.lang.String host,
int port,
boolean https)
Start an HTTP or HTTPS session with the server at the given host and port. |
void |
startSession(java.lang.String host,
int port,
Credentials creds)
Start an HTTP session with the server at the given host and port using the given default default credentials. |
void |
startSession(java.lang.String host,
int port,
Credentials creds,
boolean https)
Start an HTTP or HTTPS session with the server at the given host and port using the given default default credentials. |
void |
startSession(java.lang.String host,
int port,
java.lang.String proxyhost,
int proxyport)
Start an HTTP session with the server specified by the given host and port via the given proxyhost and proxyport. |
void |
startSession(java.net.URL url)
Start an HTTP or HTTPS session with the server specified by the protocol, host and port of the given url. |
void |
startSession(java.net.URL url,
Credentials creds)
Start an HTTP or HTTPS session with the server specified by the protocol, host and port of the given url, using the given credentials by default. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HttpClient()
Method Detail |
public HttpState getState()
state
.public void setState(HttpState state)
state
.public void startSession(java.lang.String host, int port)
host
- the host to connect toport
- the port to connect topublic void startSession(java.lang.String host, int port, boolean https)
host
- the host to connect toport
- the port to connect tohttps
- when true
, create an HTTPS sessionpublic void startSession(java.lang.String host, int port, Credentials creds)
host
- the host to connect toport
- the port to connect tocreds
- the default credentials to usepublic void startSession(java.lang.String host, int port, Credentials creds, boolean https)
host
- the host to connect toport
- the port to connect tocreds
- the default credentials to usehttps
- when true
, create an HTTPS sessionpublic void startSession(java.net.URL url)
Note that everything but the protocol, host and port of the given url is ignored.
url
- the URL
from which the protocol, host,
and port of the session are determinedpublic void startSession(java.net.URL url, Credentials creds)
Note that everything but the protocol, host and port of the given url is ignored.
creds
- the default credentials to useurl
- the URL
from which the protocol, host,
and port of the session are determinedpublic void startSession(java.lang.String host, int port, java.lang.String proxyhost, int proxyport)
host
- the host to connect toport
- the port to connect toproxyhost
- the proxy host to connect viaproxyport
- the proxy port to connect viapublic int executeMethod(HttpMethod method) throws java.io.IOException, HttpException
HttpMethod
using my current
connection
and HttpState
.method
- the HttpMethod
to executejava.io.IOException
- if an I/O error occursHttpException
- if a protocol exception occurspublic void endSession() throws java.io.IOException
connection
if any.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |