|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--autohit.transport.HTTPTransport
A HTTP transport. It uses the HTTPClient library. for http implementation specifics, see the library documentation.
I'm thinking that HTTPClient will have to get replaced. It will be slow. It works for multi-client simulation, but it isn't designed for it. I'm worried that Objects and cookies will ghost and build up.
Constructor Summary | |
HTTPTransport()
Default constructor. |
Method Summary | |
boolean |
acceptCookie(HTTPClient.Cookie cookie,
HTTPClient.RoRequest req,
HTTPClient.RoResponse resp)
Just don't use these... |
void |
connect(java.lang.String address)
Prepare to connect to a web server. |
void |
disconnect()
Disconnect transport. |
void |
environment(java.lang.String name,
java.lang.String value)
Set an environment variable for this transport. |
Response |
push(Query q)
Push a query and wait for a response. |
boolean |
sendCookie(HTTPClient.Cookie cookie,
HTTPClient.RoRequest req)
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public HTTPTransport()
Method Detail |
public void connect(java.lang.String address) throws TransportException
address
- Address specification. This should only be the DOMAIN portion
of a URL.public Response push(Query q) throws TransportException
The Query should be formed as the following: Query.headers = any non-default headers. Be careful that they they don't break how HTTPClient works. Query.qs = The URI query string including URL encoded variables. It should include the "/" after the domain in URI--such as "/cgi-bin/goats.pl" rather than "cgi-bin/goats.pl" Query.body = Any body elements. If this is null, then the http GET method will be used. Otherwise, http POST is used and this body will be the form data.
WARNING! For now, headers are not given in the Response. Reponse.header will be null.
If it is not connected or there is an underlying transport error, it will throw a TransportException.
q
- A queury specification.Query
,
Response
public void environment(java.lang.String name, java.lang.String value)
The following as defined for this transport. (Defaults shown in paren.) - Accept cookies? "cookies" == "true" or "false" (true) - Allow redirects? "redir" == "true" or "false" (true) WARNING! For now, redirects will ALWAYS be allowed. I'll have to hack the HTTPClient to change this....
Names and boolean values are NOT case sensitive.
name
- variable name.value
- variable value.public void disconnect()
If it isn't currently connected, nothing bad will happen.
public boolean acceptCookie(HTTPClient.Cookie cookie, HTTPClient.RoRequest req, HTTPClient.RoResponse resp)
public boolean sendCookie(HTTPClient.Cookie cookie, HTTPClient.RoRequest req)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |