public final class HttpClient extends Object implements Closeable
HttpClient(InetAddress, int)| Constructor and Description |
|---|
HttpClient(InetAddress address,
int port)
Connects to the given address and port.
|
HttpClient(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.
|
HttpResponse |
call(HttpRequest httpRequest,
String writeRequestLoggingPrefix,
String readResponseLoggingPrefix)
Sends the given httpRequest to the server, waits for the response from the server.
|
void |
close() |
public HttpClient(String host, int port) throws IOException
IOExceptionHttpClient(InetAddress, int)public HttpClient(InetAddress address, int port) throws IOException
IOExceptionpublic HttpResponse call(HttpRequest httpRequest) throws IOException
IOExceptionpublic HttpResponse call(HttpRequest httpRequest, String writeRequestLoggingPrefix, String readResponseLoggingPrefix) throws IOException
writeRequestLoggingPrefix - E.g. "<<< "readResponseLoggingPrefix - E.g. ">>> "IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2018 Arno Unkrig. All rights reserved.