public final class HttpClient
extends java.lang.Object
implements java.io.Closeable
HttpClient(InetAddress, int)| Constructor and Description |
|---|
HttpClient(java.net.InetAddress address,
int port)
Connects to the given
address and port. |
HttpClient(java.lang.String host,
int port) |
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
call(HttpRequest httpRequest)
Sends the given
httpRequest to the server, waits for the response from the server. |
void |
close() |
public HttpClient(java.lang.String host,
int port)
throws java.io.IOException
java.io.IOExceptionHttpClient(InetAddress, int)public HttpClient(java.net.InetAddress address,
int port)
throws java.io.IOException
address and port.java.io.IOExceptionpublic HttpResponse call(HttpRequest httpRequest) throws java.io.IOException
httpRequest to the server, waits for the response from the server.java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException