Class OkHttpHttpClient
java.lang.Object
com.github.scribejava.httpclient.okhttp.OkHttpHttpClient
- All Implemented Interfaces:
HttpClient
,Closeable
,AutoCloseable
-
Field Summary
Fields inherited from interface com.github.scribejava.core.httpclient.HttpClient
CONTENT_LENGTH, CONTENT_TYPE, DEFAULT_CONTENT_TYPE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
execute
(String userAgent, Map<String, String> headers, Verb httpVerb, String completeUrl, byte[] bodyContents) execute
(String userAgent, Map<String, String> headers, Verb httpVerb, String completeUrl, MultipartPayload bodyContents) execute
(String userAgent, Map<String, String> headers, Verb httpVerb, String completeUrl, File bodyContents) execute
(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 Details
-
OkHttpHttpClient
public OkHttpHttpClient() -
OkHttpHttpClient
-
OkHttpHttpClient
public OkHttpHttpClient(okhttp3.OkHttpClient client)
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in 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:
executeAsync
in 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:
executeAsync
in 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:
executeAsync
in 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:
executeAsync
in interfaceHttpClient
-
execute
public Response execute(String userAgent, Map<String, String> headers, Verb httpVerb, String completeUrl, byte[] bodyContents) throws InterruptedException, ExecutionException, IOException- Specified by:
execute
in interfaceHttpClient
- Throws:
InterruptedException
ExecutionException
IOException
-
execute
public Response execute(String userAgent, Map<String, String> headers, Verb httpVerb, String completeUrl, MultipartPayload bodyContents) throws InterruptedException, ExecutionException, IOException- Specified by:
execute
in interfaceHttpClient
- Throws:
InterruptedException
ExecutionException
IOException
-
execute
public Response execute(String userAgent, Map<String, String> headers, Verb httpVerb, String completeUrl, String bodyContents) throws InterruptedException, ExecutionException, IOException- Specified by:
execute
in interfaceHttpClient
- Throws:
InterruptedException
ExecutionException
IOException
-
execute
public Response execute(String userAgent, Map<String, String> headers, Verb httpVerb, String completeUrl, File bodyContents) throws InterruptedException, ExecutionException, IOException- Specified by:
execute
in interfaceHttpClient
- Throws:
InterruptedException
ExecutionException
IOException
-