org.apache.anteater.test
Class HttpClient
java.lang.Object
|
+--org.apache.anteater.test.HttpClient
- public class HttpClient
- extends Object
HTTP operations on raw sockets using HttpMessage. This class is
used by HttpRequest to perform HTTP requests.
- Since:
- October 25, 2002
- Version:
- $Revision: 1.11 $ $Date: 2003/01/18 01:42:51 $
- Author:
- Jeff Turner
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UNSET_TIMEOUT
public static final int UNSET_TIMEOUT
- See Also:
- Constant Field Values
dispatch
public static HttpMessage dispatch(HttpMessage request,
org.apache.tools.ant.Project project,
Session session,
int timeout,
Boolean useTidy,
Boolean followRedirects,
int maxRedirects,
int debug)
throws Exception
- Send the request to the specified URL. We use plain socket
(instead of the more convenient URLConnection) because we want to
check bad http, special strings, etc.
- Parameters:
request - Request to sendproject - Ant Project object used for variable interpolationsession - Session to update with returned cookiestimeout - How long to wait if the socket hangsuseTidy - Whether to use JTidy to make the body of the response well-formed.followRedirects - whether or not to transparently follow 302 HTTP redirects.maxRedirects - Max number of times to follow redirectsdebug - debug level
- Throws:
UnknownHostException - if offline
Exception - if the HTTP operation fails.
getSocket
public static Socket getSocket(HttpMessage request)
throws Exception
- Creates and returns a normal or SSL socket, depending on the
HttpMessage.isSecure() flag.
Exception
Ant Functional Tester -- see Project home page for details