public abstract class AbstractHttpClient
extends java.lang.Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected okhttp3.OkHttpClient |
client |
protected boolean |
deserializeWithContentType |
protected static java.util.Map<java.lang.String,java.lang.String> |
EMPTY
The Constant EMPTY.
|
protected okhttp3.Headers |
headers |
protected java.util.Map<java.lang.String,java.lang.String> |
headersMap |
protected org.slf4j.Logger |
logger
The logger.
|
protected okhttp3.MediaType |
mediaType |
protected cn.featherfly.common.serialization.Serialization |
serialization |
protected cn.featherfly.common.serialization.Serializer |
serializer |
| 构造器和说明 |
|---|
AbstractHttpClient()
Instantiates a new http client.
|
AbstractHttpClient(HttpRequestConfig config)
Instantiates a new http client.
|
AbstractHttpClient(HttpRequestConfig config,
java.util.Map<java.lang.String,java.lang.String> headers)
Instantiates a new http client.
|
AbstractHttpClient(HttpRequestConfig config,
java.util.Map<java.lang.String,java.lang.String> headers,
cn.featherfly.common.serialization.Serialization serialization,
okhttp3.MediaType mediaType)
Instantiates a new http client.
|
AbstractHttpClient(HttpRequestConfig config,
cn.featherfly.common.serialization.Serialization serialization,
okhttp3.MediaType mediaType)
Instantiates a new http client.
|
AbstractHttpClient(java.util.Map<java.lang.String,java.lang.String> headers)
Instantiates a new http client.
|
AbstractHttpClient(okhttp3.OkHttpClient client,
java.util.Map<java.lang.String,java.lang.String> headers)
Instantiates a new http client.
|
AbstractHttpClient(okhttp3.OkHttpClient client,
java.util.Map<java.lang.String,java.lang.String> headers,
cn.featherfly.common.serialization.Serialization serialization,
okhttp3.MediaType mediaType)
Instantiates a new http client.
|
AbstractHttpClient(okhttp3.OkHttpClient client,
cn.featherfly.common.serialization.Serialization serialization,
okhttp3.MediaType mediaType)
Instantiates a new http client.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected okhttp3.Headers |
createHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Creates the headers.
|
protected <T> T |
deserialize(okhttp3.Response response,
java.lang.Class<T> responseType)
Deserialize.
|
java.util.Set<java.lang.Integer> |
getCodeSameAsSuccess()
get codeSameAsSuccess value
|
protected cn.featherfly.common.serialization.Serializer |
getSerializer(okhttp3.MediaType mediaType,
boolean throwExceptionNoSerializer)
Gets the serializer.
|
protected void |
init(HttpRequestConfig config,
java.util.Map<java.lang.String,java.lang.String> headers,
cn.featherfly.common.serialization.Serialization serialization,
okhttp3.MediaType mediaType)
Inits the.
|
protected void |
init(okhttp3.OkHttpClient client,
java.util.Map<java.lang.String,java.lang.String> headers,
cn.featherfly.common.serialization.Serialization serialization,
okhttp3.MediaType mediaType)
Inits the.
|
protected boolean |
isCodeSameAsSuccess(okhttp3.Response response) |
boolean |
isDeserializeWithContentType()
get deserializeWithContentType value.
|
void |
setCodeSameAsSuccess(java.util.Set<java.lang.Integer> codeSameAsSuccess)
set codeSameAsSuccess value
|
void |
setDeserializeWithContentType(boolean deserializeWithContentType)
set deserializeWithContentType value.
|
void |
shutdown()
Shutdown.
|
protected static final java.util.Map<java.lang.String,java.lang.String> EMPTY
protected final org.slf4j.Logger logger
protected okhttp3.OkHttpClient client
protected boolean deserializeWithContentType
protected cn.featherfly.common.serialization.Serialization serialization
protected cn.featherfly.common.serialization.Serializer serializer
protected okhttp3.MediaType mediaType
protected okhttp3.Headers headers
protected java.util.Map<java.lang.String,java.lang.String> headersMap
public AbstractHttpClient()
public AbstractHttpClient(HttpRequestConfig config)
config - the configpublic AbstractHttpClient(java.util.Map<java.lang.String,java.lang.String> headers)
headers - the headerspublic AbstractHttpClient(HttpRequestConfig config, java.util.Map<java.lang.String,java.lang.String> headers)
config - the configheaders - the headerspublic AbstractHttpClient(HttpRequestConfig config, cn.featherfly.common.serialization.Serialization serialization, okhttp3.MediaType mediaType)
config - the configserialization - the serializationmediaType - the media typepublic AbstractHttpClient(HttpRequestConfig config, java.util.Map<java.lang.String,java.lang.String> headers, cn.featherfly.common.serialization.Serialization serialization, okhttp3.MediaType mediaType)
config - the configheaders - the headersserialization - the serializationmediaType - the media typepublic AbstractHttpClient(okhttp3.OkHttpClient client,
java.util.Map<java.lang.String,java.lang.String> headers)
client - the clientheaders - the headerspublic AbstractHttpClient(okhttp3.OkHttpClient client,
cn.featherfly.common.serialization.Serialization serialization,
okhttp3.MediaType mediaType)
client - the clientserialization - the serializationmediaType - the media typepublic AbstractHttpClient(okhttp3.OkHttpClient client,
java.util.Map<java.lang.String,java.lang.String> headers,
cn.featherfly.common.serialization.Serialization serialization,
okhttp3.MediaType mediaType)
client - the clientheaders - the headersserialization - the serializationmediaType - the media typeprotected void init(HttpRequestConfig config, java.util.Map<java.lang.String,java.lang.String> headers, cn.featherfly.common.serialization.Serialization serialization, okhttp3.MediaType mediaType)
config - the configheaders - the headersserialization - the serializationmediaType - the media typeprotected void init(okhttp3.OkHttpClient client,
java.util.Map<java.lang.String,java.lang.String> headers,
cn.featherfly.common.serialization.Serialization serialization,
okhttp3.MediaType mediaType)
client - the clientheaders - the headersserialization - the serializationmediaType - the media typepublic void shutdown()
public boolean isDeserializeWithContentType()
public java.util.Set<java.lang.Integer> getCodeSameAsSuccess()
public void setCodeSameAsSuccess(java.util.Set<java.lang.Integer> codeSameAsSuccess)
codeSameAsSuccess - codeSameAsSuccesspublic void setDeserializeWithContentType(boolean deserializeWithContentType)
deserializeWithContentType - deserializeWithContentTypeprotected <T> T deserialize(okhttp3.Response response,
java.lang.Class<T> responseType)
throws java.io.IOException
T - the generic typeresponse - the responseresponseType - the response typejava.io.IOException - Signals that an I/O exception has occurred.protected cn.featherfly.common.serialization.Serializer getSerializer(okhttp3.MediaType mediaType,
boolean throwExceptionNoSerializer)
mediaType - the media typethrowExceptionNoSerializer - the throw exception no serializerprotected okhttp3.Headers createHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
headers - the headersprotected boolean isCodeSameAsSuccess(okhttp3.Response response)