public class HttpUtil extends Object
| 构造器和说明 |
|---|
HttpUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static com.alibaba.fastjson.JSONObject |
httpRequest(String request,
String requestMethod,
String output) |
static com.alibaba.fastjson.JSONObject |
httpRequest(String request,
String requestMethod,
String output,
com.alibaba.fastjson.JSONObject headers)
发起https请求并获取结果
|
static <T> Response<T> |
post(String url,
String output,
Type... types)
http post请求
|
static com.alibaba.fastjson.JSONObject |
sendGet(String url)
http get请求
|
static com.alibaba.fastjson.JSONObject |
sendPost(String url)
http post请求
|
static com.alibaba.fastjson.JSONObject |
sendPost(String url,
String output)
http post请求
|
public static com.alibaba.fastjson.JSONObject sendGet(String url)
url - public static com.alibaba.fastjson.JSONObject sendPost(String url)
url - public static com.alibaba.fastjson.JSONObject sendPost(String url, String output)
url - output - json串public static <T> Response<T> post(String url, String output, Type... types)
url - 请求地址output - json串public static com.alibaba.fastjson.JSONObject httpRequest(String request, String requestMethod, String output)
public static com.alibaba.fastjson.JSONObject httpRequest(String request, String requestMethod, String output, com.alibaba.fastjson.JSONObject headers)
request - 请求地址requestMethod - 请求方式(GET、POST)output - 提交的数据headers - 请求头Copyright © 2022. All rights reserved.