Package com.xxl.tool.http.client
Class HttpClient
java.lang.Object
com.xxl.tool.http.client.HttpClient
http client
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription设置鉴权信息设置Cookie设置Cookie,覆盖更新设置请求头设置请求头,覆盖更新static StringparseMethodPath(HttpClientMethod httpRpcMethod, Method method) parse methodPath: method-annotation > method-namestatic StringparseServicePath(HttpClientService httpRpcService, Class<?> serviceInterface) parse servicePath: service-annotation<T> Thttp client proxytimeout(int timeout) 超时时间设置URL
-
Constructor Details
-
HttpClient
public HttpClient()
-
-
Method Details
-
url
设置URL -
header
设置请求头,覆盖更新 -
header
设置请求头 -
cookie
设置Cookie,覆盖更新 -
cookie
设置Cookie -
timeout
超时时间 -
auth
设置鉴权信息 -
proxy
http client proxy- Type Parameters:
T- the service interface type- Parameters:
serviceInterface- the service interface- Returns:
- the proxy instance
-
parseServicePath
parse servicePath: service-annotation- Parameters:
httpRpcService- service-annotationserviceInterface- service-class- Returns:
- servicePathFinal
-
parseMethodPath
parse methodPath: method-annotation > method-name- Parameters:
httpRpcMethod- method-annotationmethod- method- Returns:
- methodPath
-