Class OkHttpHttpClient
- java.lang.Object
-
- com.github.scribejava.httpclient.okhttp.OkHttpHttpClient
-
- All Implemented Interfaces:
HttpClient,Closeable,AutoCloseable
public class OkHttpHttpClient extends Object implements HttpClient
-
-
Field Summary
-
Fields inherited from interface com.github.scribejava.core.httpclient.HttpClient
CONTENT_LENGTH, CONTENT_TYPE, DEFAULT_CONTENT_TYPE
-
-
Constructor Summary
Constructors Constructor Description OkHttpHttpClient()OkHttpHttpClient(OkHttpHttpClientConfig config)OkHttpHttpClient(okhttp3.OkHttpClient client)
-
Method Summary
Modifier and Type Method Description voidclose()Responseexecute(String userAgent, Map<String,String> headers, Verb httpVerb, String completeUrl, byte[] bodyContents)Responseexecute(String userAgent, Map<String,String> headers, Verb httpVerb, String completeUrl, MultipartPayload bodyContents)Responseexecute(String userAgent, Map<String,String> headers, Verb httpVerb, String completeUrl, File bodyContents)Responseexecute(String userAgent, Map<String,String> headers, Verb httpVerb, String completeUrl, String bodyContents)<T> Future<T>executeAsync(String userAgent, Map<String,String> headers, Verb httpVerb, String completeUrl, byte[] bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter)<T> Future<T>executeAsync(String userAgent, Map<String,String> headers, Verb httpVerb, String completeUrl, MultipartPayload bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter)<T> Future<T>executeAsync(String userAgent, Map<String,String> headers, Verb httpVerb, String completeUrl, File bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter)<T> Future<T>executeAsync(String userAgent, Map<String,String> headers, Verb httpVerb, String completeUrl, String bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter)
-
-
-
Constructor Detail
-
OkHttpHttpClient
public OkHttpHttpClient()
-
OkHttpHttpClient
public OkHttpHttpClient(OkHttpHttpClientConfig config)
-
OkHttpHttpClient
public OkHttpHttpClient(okhttp3.OkHttpClient client)
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
executeAsync
public <T> Future<T> executeAsync(String userAgent, Map<String,String> headers, Verb httpVerb, String completeUrl, byte[] bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter)
- Specified by:
executeAsyncin interfaceHttpClient
-
executeAsync
public <T> Future<T> executeAsync(String userAgent, Map<String,String> headers, Verb httpVerb, String completeUrl, MultipartPayload bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter)
- Specified by:
executeAsyncin interfaceHttpClient
-
executeAsync
public <T> Future<T> executeAsync(String userAgent, Map<String,String> headers, Verb httpVerb, String completeUrl, String bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter)
- Specified by:
executeAsyncin interfaceHttpClient
-
executeAsync
public <T> Future<T> executeAsync(String userAgent, Map<String,String> headers, Verb httpVerb, String completeUrl, File bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter)
- Specified by:
executeAsyncin interfaceHttpClient
-
execute
public Response execute(String userAgent, Map<String,String> headers, Verb httpVerb, String completeUrl, byte[] bodyContents) throws InterruptedException, ExecutionException, IOException
- Specified by:
executein interfaceHttpClient- Throws:
InterruptedExceptionExecutionExceptionIOException
-
execute
public Response execute(String userAgent, Map<String,String> headers, Verb httpVerb, String completeUrl, MultipartPayload bodyContents) throws InterruptedException, ExecutionException, IOException
- Specified by:
executein interfaceHttpClient- Throws:
InterruptedExceptionExecutionExceptionIOException
-
execute
public Response execute(String userAgent, Map<String,String> headers, Verb httpVerb, String completeUrl, String bodyContents) throws InterruptedException, ExecutionException, IOException
- Specified by:
executein interfaceHttpClient- Throws:
InterruptedExceptionExecutionExceptionIOException
-
execute
public Response execute(String userAgent, Map<String,String> headers, Verb httpVerb, String completeUrl, File bodyContents) throws InterruptedException, ExecutionException, IOException
- Specified by:
executein interfaceHttpClient- Throws:
InterruptedExceptionExecutionExceptionIOException
-
-