Package me.zhyd.oauth.utils
Class HttpUtils
java.lang.Object
me.zhyd.oauth.utils.HttpUtils
HttpUtil 工具,统一处理 http 请求,方便对 simple-http 做定制
- Since:
- 1.0.0
- Version:
- 1.0.0
- Author:
- yadong.zhang (yadong.zhang0415(a)gmail.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGET 请求get(String url, Map<String, String> params, com.xkcoding.http.support.HttpHeader header, boolean encode) GET 请求getBody()com.xkcoding.http.support.SimpleHttpResponsePOST 请求POST 请求POST 请求POST 请求post(String url, Map<String, String> params, com.xkcoding.http.support.HttpHeader header, boolean encode) POST 请求
-
Constructor Details
-
HttpUtils
public HttpUtils(com.xkcoding.http.config.HttpConfig config) -
HttpUtils
public HttpUtils()
-
-
Method Details
-
get
GET 请求- Parameters:
url- URL- Returns:
- HttpUtils
-
get
public HttpUtils get(String url, Map<String, String> params, com.xkcoding.http.support.HttpHeader header, boolean encode) GET 请求- Parameters:
url- URLparams- 参数header- 请求头encode- 是否需要 url encode- Returns:
- HttpUtils
-
post
POST 请求- Parameters:
url- URL- Returns:
- HttpUtils
-
post
POST 请求- Parameters:
url- URLdata- JSON 参数- Returns:
- HttpUtils
-
post
POST 请求- Parameters:
url- URLdata- JSON 参数header- 请求头- Returns:
- HttpUtils
-
post
POST 请求- Parameters:
url- URLparams- form 参数encode- 是否需要 url encode- Returns:
- HttpUtils
-
post
public HttpUtils post(String url, Map<String, String> params, com.xkcoding.http.support.HttpHeader header, boolean encode) POST 请求- Parameters:
url- URLparams- form 参数header- 请求头encode- 是否需要 url encode- Returns:
- HttpUtils
-
getBody
-
getHttpResponse
public com.xkcoding.http.support.SimpleHttpResponse getHttpResponse()
-