Package cn.toutatis.xvoid.toolkit.http
Object HttpToolkit
-
- All Implemented Interfaces:
public class HttpToolkitToutatis_Gc
-
-
Field Summary
Fields Modifier and Type Field Description public final static HttpToolkitINSTANCE
-
Method Summary
Modifier and Type Method Description final static StringsyncGet(String url)final static StringsyncGet(String url, Map<String, String> params)final static StringsyncGet(String url, Map<String, String> params, Map<String, String> headers)同步GET请求 final static StringsyncGet(String url, Map<String, String> params, Map<String, String> headers, Boolean throwException)final static ByteArraysyncGetAsBytes(String url, Map<String, String> params, Map<String, String> headers, Boolean throwException)final static ResponsesyncGetAsResponse(String url)final static ResponsesyncGetAsResponse(String url, Map<String, String> params)final static ResponsesyncGetAsResponse(String url, Map<String, String> params, Map<String, String> headers)final static ResponsesyncGetAsResponse(String url, Map<String, String> params, Map<String, String> headers, Boolean throwException)final static Stringpost(String url, Map<String, String> formBody, Map<String, String> headers, Boolean throwException)final static StringconcatMapParameters(String url, Map<String, String> queries)final static ResponsegetResponse(Request request, Boolean throwException)Get response 获取响应 -
-
Method Detail
-
syncGet
final static String syncGet(String url, Map<String, String> params, Map<String, String> headers)
同步GET请求
-
syncGet
final static String syncGet(String url, Map<String, String> params, Map<String, String> headers, Boolean throwException)
-
syncGetAsBytes
final static ByteArray syncGetAsBytes(String url, Map<String, String> params, Map<String, String> headers, Boolean throwException)
-
syncGetAsResponse
final static Response syncGetAsResponse(String url)
-
syncGetAsResponse
final static Response syncGetAsResponse(String url, Map<String, String> params)
-
syncGetAsResponse
final static Response syncGetAsResponse(String url, Map<String, String> params, Map<String, String> headers)
-
syncGetAsResponse
final static Response syncGetAsResponse(String url, Map<String, String> params, Map<String, String> headers, Boolean throwException)
-
post
final static String post(String url, Map<String, String> formBody, Map<String, String> headers, Boolean throwException)
- Parameters:
url- post请求地址formBody- 参数- Returns:
请求响应体
-
concatMapParameters
final static String concatMapParameters(String url, Map<String, String> queries)
- Parameters:
url- URL地址queries- query参数- Returns:
拼接URL请求地址和query参数为一条地址
-
getResponse
final static Response getResponse(Request request, Boolean throwException)
Get response 获取响应
- Parameters:
request- 请求throwException- 是否抛出异常- Returns:
响应实体
-
-
-
-