Class OkHttpHttpClient
java.lang.Object
com.github.scribejava.httpclient.okhttp.OkHttpHttpClient
- All Implemented Interfaces:
HttpClient
,java.io.Closeable
,java.lang.AutoCloseable
public class OkHttpHttpClient extends java.lang.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 void
close()
Response
execute(java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> headers, Verb httpVerb, java.lang.String completeUrl, byte[] bodyContents)
Response
execute(java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> headers, Verb httpVerb, java.lang.String completeUrl, MultipartPayload bodyContents)
Response
execute(java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> headers, Verb httpVerb, java.lang.String completeUrl, java.io.File bodyContents)
Response
execute(java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> headers, Verb httpVerb, java.lang.String completeUrl, java.lang.String bodyContents)
<T> java.util.concurrent.Future<T>
executeAsync(java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> headers, Verb httpVerb, java.lang.String completeUrl, byte[] bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter)
<T> java.util.concurrent.Future<T>
executeAsync(java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> headers, Verb httpVerb, java.lang.String completeUrl, MultipartPayload bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter)
<T> java.util.concurrent.Future<T>
executeAsync(java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> headers, Verb httpVerb, java.lang.String completeUrl, java.io.File bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter)
<T> java.util.concurrent.Future<T>
executeAsync(java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> headers, Verb httpVerb, java.lang.String completeUrl, java.lang.String bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter)
-
Constructor Details
-
OkHttpHttpClient
public OkHttpHttpClient() -
OkHttpHttpClient
-
OkHttpHttpClient
public OkHttpHttpClient(okhttp3.OkHttpClient client)
-
-
Method Details
-
close
public void close() throws java.io.IOException- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
executeAsync
public <T> java.util.concurrent.Future<T> executeAsync(java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> headers, Verb httpVerb, java.lang.String completeUrl, byte[] bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter)- Specified by:
executeAsync
in interfaceHttpClient
-
executeAsync
public <T> java.util.concurrent.Future<T> executeAsync(java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> headers, Verb httpVerb, java.lang.String completeUrl, MultipartPayload bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter)- Specified by:
executeAsync
in interfaceHttpClient
-
executeAsync
public <T> java.util.concurrent.Future<T> executeAsync(java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> headers, Verb httpVerb, java.lang.String completeUrl, java.lang.String bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter)- Specified by:
executeAsync
in interfaceHttpClient
-
executeAsync
public <T> java.util.concurrent.Future<T> executeAsync(java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> headers, Verb httpVerb, java.lang.String completeUrl, java.io.File bodyContents, OAuthAsyncRequestCallback<T> callback, OAuthRequest.ResponseConverter<T> converter)- Specified by:
executeAsync
in interfaceHttpClient
-
execute
public Response execute(java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> headers, Verb httpVerb, java.lang.String completeUrl, byte[] bodyContents) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.io.IOException- Specified by:
execute
in interfaceHttpClient
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.io.IOException
-
execute
public Response execute(java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> headers, Verb httpVerb, java.lang.String completeUrl, MultipartPayload bodyContents) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.io.IOException- Specified by:
execute
in interfaceHttpClient
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.io.IOException
-
execute
public Response execute(java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> headers, Verb httpVerb, java.lang.String completeUrl, java.lang.String bodyContents) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.io.IOException- Specified by:
execute
in interfaceHttpClient
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.io.IOException
-
execute
public Response execute(java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> headers, Verb httpVerb, java.lang.String completeUrl, java.io.File bodyContents) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.io.IOException- Specified by:
execute
in interfaceHttpClient
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.io.IOException
-