public class YzhClient extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
<K,T> YzhResponse<T> |
get(YzhRequest<K> yzhRequest,
String url,
boolean isEncrypt,
com.google.gson.reflect.TypeToken<YzhResponse<T>> typeToken)
GET请求
|
<T> Type |
getResponseType(com.google.gson.reflect.TypeToken<YzhResponse<T>> typeToken)
获取TypeToken对应 T 的type
|
int |
getSocketTimeout() |
YzhConfig |
getYzhConfig() |
YzhSign |
getYzhSign() |
void |
handleError(YzhRequest<?> req,
Exception e) |
<K,T> YzhResponse<T> |
post(YzhRequest<K> yzhRequest,
String url,
com.google.gson.reflect.TypeToken<YzhResponse<T>> typeToken)
post 请求
|
void |
setSocketTimeout(int socketTimeout) |
void |
setYzhConfig(YzhConfig yzhConfig) |
void |
setYzhSign(YzhSign yzhSign) |
protected YzhSign.SignedData |
sign(Object request) |
public YzhClient(YzhConfig yzhConfig)
protected YzhSign.SignedData sign(Object request) throws Exception
Exceptionpublic YzhSign getYzhSign()
public void setYzhSign(YzhSign yzhSign)
public YzhConfig getYzhConfig()
public void setYzhConfig(YzhConfig yzhConfig)
public int getSocketTimeout()
public void setSocketTimeout(int socketTimeout)
public <K,T> YzhResponse<T> post(YzhRequest<K> yzhRequest, String url, com.google.gson.reflect.TypeToken<YzhResponse<T>> typeToken) throws Exception
yzhRequest - 请求内容url - 接口地址typeToken - 反序列化返回类型Exceptionpublic <K,T> YzhResponse<T> get(YzhRequest<K> yzhRequest, String url, boolean isEncrypt, com.google.gson.reflect.TypeToken<YzhResponse<T>> typeToken) throws Exception
yzhRequest - 请求内容url - 接口地址isEncrypt - 接口返回内容是否进行加密typeToken - 反序列化返回类型Exceptionpublic <T> Type getResponseType(com.google.gson.reflect.TypeToken<YzhResponse<T>> typeToken)
T - TtypeToken - 类型public void handleError(YzhRequest<?> req, Exception e)
Copyright © 2025. All rights reserved.