public class OkHttpClient extends java.lang.Object implements HttpClient
| Modifier and Type | Class and Description |
|---|---|
static class |
OkHttpClient.Factory |
| Constructor and Description |
|---|
OkHttpClient(okhttp3.OkHttpClient client,
java.net.URL url) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connections associated with this client.
|
HttpResponse |
execute(HttpRequest request)
Executes the given request, following any redirects if necessary.
|
HttpResponse |
execute(HttpRequest request,
boolean followRedirects)
Executes the given request.
|
public HttpResponse execute(HttpRequest request) throws java.io.IOException
HttpClientexecute in interface HttpClientrequest - the request to execute.java.io.IOException - if an I/O error occurs.public HttpResponse execute(HttpRequest request, boolean followRedirects) throws java.io.IOException
HttpClientexecute in interface HttpClientrequest - the request to execute.followRedirects - whether to automatically follow redirects.java.io.IOException - if an I/O error occurs.public void close()
HttpClientclose in interface HttpClient