public class OkHttpRequest extends java.lang.Object implements HttpRequest
| 限定符和类型 | 字段和说明 |
|---|---|
protected org.slf4j.Logger |
logger
The logger.
|
| 构造器和说明 |
|---|
OkHttpRequest(HttpRequestConfig config)
Instantiates a new ok http request.
|
OkHttpRequest(HttpRequestConfig config,
cn.featherfly.common.serialization.Serialization serialization)
Instantiates a new ok http request.
|
OkHttpRequest(HttpRequestConfig config,
cn.featherfly.common.serialization.Serialization serialization,
okhttp3.MediaType mediaType)
Instantiates a new ok http request.
|
OkHttpRequest(okhttp3.OkHttpClient okHttpClient,
cn.featherfly.common.serialization.Serialization serialization,
okhttp3.MediaType mediaType)
Instantiates a new ok http request.
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
isDeserializeWithContentType()
get deserializeWithContentType value.
|
protected <T> void |
preSend(HttpMethod method,
java.lang.StringBuilder url,
java.lang.Object params,
java.util.Map<java.lang.String,java.lang.String> headers,
java.lang.Class<T> responseType)
Pre send.
|
<T> T |
send(HttpMethod method,
java.lang.String url,
java.util.Map<java.lang.String,java.io.Serializable> params,
java.lang.Class<T> responseType,
ErrorListener errorListener)
发送请求(请求体作为参数),异步网络请求,使用Future转换为同步方法调用方式.
|
<T> T |
send(HttpMethod method,
java.lang.String url,
java.util.Map<java.lang.String,java.io.Serializable> params,
java.util.Map<java.lang.String,java.lang.String> headers,
java.lang.Class<T> responseType,
ErrorListener errorListener)
发送请求(请求体作为参数),异步网络请求,使用Future转换为同步方法调用方式.
|
<R,T> T |
send(HttpMethod method,
java.lang.String url,
R requestBody,
java.lang.Class<T> responseType,
ErrorListener errorListener)
发送请求(请求体作为参数),异步网络请求,使用Future转换为同步方法调用方式.
|
<R,T> T |
send(HttpMethod method,
java.lang.String url,
R requestBody,
java.util.Map<java.lang.String,java.lang.String> headers,
java.lang.Class<T> responseType,
ErrorListener errorListener)
发送请求(请求体作为参数),异步网络请求,使用Future转换为同步方法调用方式.
|
<R,T> T |
send(HttpMethod method,
java.lang.String url,
R requestBody,
java.util.Map<java.lang.String,java.lang.String> headers,
java.lang.Class<T> responseType,
ErrorListener errorListener,
long requestTimeoutSeconds)
发送请求(请求体作为参数),异步网络请求,使用Future转换为同步方法调用方式.
|
<T> HttpRequestCompletion<T> |
sendCompletion(HttpMethod method,
java.lang.String url,
java.util.Map<java.lang.String,java.io.Serializable> params,
java.lang.Class<T> responseType)
发送请求(请求体作为参数),异步网络请求,回调处理.
|
<T> HttpRequestCompletion<T> |
sendCompletion(HttpMethod method,
java.lang.String url,
java.util.Map<java.lang.String,java.io.Serializable> params,
java.util.Map<java.lang.String,java.lang.String> headers,
java.lang.Class<T> responseType)
发送请求(请求体作为参数),异步网络请求,回调处理.
|
<R,T> HttpRequestCompletion<T> |
sendCompletion(HttpMethod method,
java.lang.String url,
R requestBody,
java.lang.Class<T> responseType)
发送请求(请求体作为参数),异步网络请求,回调处理.
|
<R,T> HttpRequestCompletion<T> |
sendCompletion(HttpMethod method,
java.lang.String url,
R requestBody,
java.util.Map<java.lang.String,java.lang.String> headers,
java.lang.Class<T> responseType)
发送请求(请求体作为参数),异步网络请求,回调处理.
|
<T> io.reactivex.Observable<T> |
sendObservable(HttpMethod method,
java.lang.String url,
java.util.Map<java.lang.String,java.io.Serializable> params,
java.lang.Class<T> responseType)
发送请求(请求体作为参数),异步网络请求,回调处理.
|
<T> io.reactivex.Observable<T> |
sendObservable(HttpMethod method,
java.lang.String url,
java.util.Map<java.lang.String,java.io.Serializable> params,
java.util.Map<java.lang.String,java.lang.String> headers,
java.lang.Class<T> responseType)
发送请求(请求体作为参数),异步网络请求,回调处理.
|
<R,T> io.reactivex.Observable<T> |
sendObservable(HttpMethod method,
java.lang.String url,
R requestBody,
java.lang.Class<T> responseType)
发送请求(请求体作为参数),异步网络请求,回调处理.
|
<R,T> io.reactivex.Observable<T> |
sendObservable(HttpMethod method,
java.lang.String url,
R requestBody,
java.util.Map<java.lang.String,java.lang.String> headers,
java.lang.Class<T> responseType)
发送请求(请求体作为参数),异步网络请求,回调处理.
|
void |
setDeserializeWithContentType(boolean deserializeWithContentType)
set deserializeWithContentType value.
|
void |
shutdown()
Shutdown.
|
public OkHttpRequest(HttpRequestConfig config)
config - the configpublic OkHttpRequest(HttpRequestConfig config, cn.featherfly.common.serialization.Serialization serialization)
config - the configserialization - the serializationpublic OkHttpRequest(HttpRequestConfig config, cn.featherfly.common.serialization.Serialization serialization, okhttp3.MediaType mediaType)
config - the configserialization - the serializationmediaType - the media typepublic OkHttpRequest(okhttp3.OkHttpClient okHttpClient,
cn.featherfly.common.serialization.Serialization serialization,
okhttp3.MediaType mediaType)
okHttpClient - the ok http clientserialization - the serializationmediaType - the media typepublic <R,T> HttpRequestCompletion<T> sendCompletion(HttpMethod method, java.lang.String url, R requestBody, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.Class<T> responseType)
sendCompletion 在接口中 HttpRequestR - 请求对象类型T - 返回内容转换的对象类型method - httpmethodurl - urlrequestBody - 请求体参数headers - 请求头responseType - 返回类型public <R,T> T send(HttpMethod method, java.lang.String url, R requestBody, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.Class<T> responseType, ErrorListener errorListener)
send 在接口中 HttpRequestR - 请求对象类型T - 返回内容转换的对象类型method - httpmethodurl - urlrequestBody - 请求体参数headers - 请求头responseType - 返回类型errorListener - 错误监听器public <R,T> T send(HttpMethod method, java.lang.String url, R requestBody, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.Class<T> responseType, ErrorListener errorListener, long requestTimeoutSeconds)
send 在接口中 HttpRequestR - 请求对象类型T - 返回内容转换的对象类型method - httpmethodurl - urlrequestBody - 请求体参数headers - 请求头responseType - 返回类型errorListener - 错误监听器requestTimeoutSeconds - 请求超时时间public <T> HttpRequestCompletion<T> sendCompletion(HttpMethod method, java.lang.String url, java.util.Map<java.lang.String,java.io.Serializable> params, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.Class<T> responseType)
sendCompletion 在接口中 HttpRequestT - 返回内容转换的对象类型method - httpmethodurl - urlparams - 请求参数headers - 请求头responseType - 返回类型public <T> T send(HttpMethod method, java.lang.String url, java.util.Map<java.lang.String,java.io.Serializable> params, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.Class<T> responseType, ErrorListener errorListener)
send 在接口中 HttpRequestT - 返回内容转换的对象类型method - httpmethodurl - urlparams - 请求参数headers - 请求头responseType - 返回类型errorListener - 错误监听器public <R,T> HttpRequestCompletion<T> sendCompletion(HttpMethod method, java.lang.String url, R requestBody, java.lang.Class<T> responseType)
sendCompletion 在接口中 HttpRequestR - 请求对象类型T - 返回内容转换的对象类型method - httpmethodurl - urlrequestBody - 请求体参数responseType - 返回类型public <R,T> T send(HttpMethod method, java.lang.String url, R requestBody, java.lang.Class<T> responseType, ErrorListener errorListener)
send 在接口中 HttpRequestR - 请求对象类型T - 返回内容转换的对象类型method - httpmethodurl - urlrequestBody - 请求体参数responseType - 返回类型errorListener - 错误监听器public <T> HttpRequestCompletion<T> sendCompletion(HttpMethod method, java.lang.String url, java.util.Map<java.lang.String,java.io.Serializable> params, java.lang.Class<T> responseType)
sendCompletion 在接口中 HttpRequestT - 返回内容转换的对象类型method - httpmethodurl - urlparams - 请求参数responseType - 返回类型public <R,T> io.reactivex.Observable<T> sendObservable(HttpMethod method, java.lang.String url, R requestBody, java.lang.Class<T> responseType)
sendObservable 在接口中 HttpRequestR - 请求对象类型T - 返回内容转换的对象类型method - httpmethodurl - urlrequestBody - 请求体参数responseType - 返回类型public <R,T> io.reactivex.Observable<T> sendObservable(HttpMethod method, java.lang.String url, R requestBody, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.Class<T> responseType)
sendObservable 在接口中 HttpRequestR - 请求对象类型T - 返回内容转换的对象类型method - httpmethodurl - urlrequestBody - 请求体参数headers - 请求头responseType - 返回类型public <T> io.reactivex.Observable<T> sendObservable(HttpMethod method, java.lang.String url, java.util.Map<java.lang.String,java.io.Serializable> params, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.Class<T> responseType)
sendObservable 在接口中 HttpRequestT - 返回内容转换的对象类型method - httpmethodurl - urlparams - 请求参数headers - 请求头responseType - 返回类型public <T> io.reactivex.Observable<T> sendObservable(HttpMethod method, java.lang.String url, java.util.Map<java.lang.String,java.io.Serializable> params, java.lang.Class<T> responseType)
sendObservable 在接口中 HttpRequestT - 返回内容转换的对象类型method - httpmethodurl - urlparams - 请求参数responseType - 返回类型public <T> T send(HttpMethod method, java.lang.String url, java.util.Map<java.lang.String,java.io.Serializable> params, java.lang.Class<T> responseType, ErrorListener errorListener)
send 在接口中 HttpRequestT - 返回内容转换的对象类型method - httpmethodurl - urlparams - 请求参数responseType - 返回类型errorListener - 错误监听器protected <T> void preSend(HttpMethod method, java.lang.StringBuilder url, java.lang.Object params, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.Class<T> responseType)
T - the generic typemethod - the methodurl - the urlparams - the paramsheaders - the headersresponseType - the response typepublic void shutdown()
public boolean isDeserializeWithContentType()
public void setDeserializeWithContentType(boolean deserializeWithContentType)
deserializeWithContentType - deserializeWithContentType