public class HttpUtils extends Object
Constructor and Description |
---|
HttpUtils() |
HttpUtils(com.xkcoding.http.config.HttpConfig config) |
Modifier and Type | Method and Description |
---|---|
String |
get(String url)
GET 请求
|
String |
get(String url,
Map<String,String> params,
com.xkcoding.http.support.HttpHeader header,
boolean encode)
GET 请求
|
String |
post(String url)
POST 请求
|
String |
post(String url,
Map<String,String> params,
boolean encode)
POST 请求
|
String |
post(String url,
Map<String,String> params,
com.xkcoding.http.support.HttpHeader header,
boolean encode)
POST 请求
|
String |
post(String url,
String data)
POST 请求
|
String |
post(String url,
String data,
com.xkcoding.http.support.HttpHeader header)
POST 请求
|
public HttpUtils(com.xkcoding.http.config.HttpConfig config)
public HttpUtils()
public String get(String url, Map<String,String> params, com.xkcoding.http.support.HttpHeader header, boolean encode)
url
- URLparams
- 参数header
- 请求头encode
- 是否需要 url encodepublic String post(String url, String data)
url
- URLdata
- JSON 参数public String post(String url, String data, com.xkcoding.http.support.HttpHeader header)
url
- URLdata
- JSON 参数header
- 请求头public String post(String url, Map<String,String> params, boolean encode)
url
- URLparams
- form 参数encode
- 是否需要 url encodeCopyright © 2021. All rights reserved.