程序包 top.lieder
类 RestAPI
java.lang.Object
top.lieder.RestAPI
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明通用GET函数get(String urlStr, Map<String, Object> params, boolean withParseJson, org.springframework.http.HttpHeaders headers) get(String urlStr, Map<String, Object> params, boolean withParseJson, org.springframework.http.HttpHeaders headers, boolean urlEncode) static StringgetGETUrlFromBody(String url, Map<String, ?> body, boolean urlEncode) 根据body生成GET中带键值对的url,目的是和POST保持调用格式一致通用POST函数post(String urlStr, Map<String, Object> request_body, boolean allowNullMap, boolean withParseJson, int timeout) post(String urlStr, Map<String, Object> request_body, boolean allowNullMap, boolean withParseJson, int timeout, org.springframework.http.HttpHeaders headers) post(String urlStr, Map<String, Object> request_body, boolean allowNullMap, boolean withParseJson, int timeout, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpHeaders responseHeaders) post(String urlStr, Map<String, Object> request_body, boolean withParseJson, int timeout, org.springframework.http.HttpHeaders headers) post(String urlStr, Map<String, Object> request_body, boolean withParseJson, org.springframework.http.HttpHeaders headers) postForm(String urlStr, Map<String, Object> request_body, boolean ifNeedParseJson, org.springframework.http.HttpHeaders headers) static StringpostStream(String url, String json, String fileName)
-
构造器详细资料
-
RestAPI
public RestAPI()
-
-
方法详细资料
-
get
通用GET函数- 参数:
urlStr- url,不带键值对params- 参数Map- 返回:
- 访问返回值
-
get
-
getGETUrlFromBody
根据body生成GET中带键值对的url,目的是和POST保持调用格式一致- 参数:
url- 原urlbody- 参数Map- 返回:
- 生成url
-
get
-
get
-
post
通用POST函数- 参数:
urlStr- url,不带键值对request_body- 参数Map- 返回:
- 访问返回值
-
post
-
post
-
post
-
post
-
post
-
post
-
postStream
- 抛出:
Exception
-
postForm
-