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
IOException
HttpClient(InetAddress, int)
public HttpClient(InetAddress address, int port) throws IOException
IOException
public HttpResponse call(HttpRequest httpRequest) throws IOException
IOException
public HttpResponse call(HttpRequest httpRequest, String writeRequestLoggingPrefix, String readResponseLoggingPrefix) throws IOException
writeRequestLoggingPrefix
- E.g. "<<< "
readResponseLoggingPrefix
- E.g. ">>> "
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2018 Arno Unkrig. All rights reserved.