类 HttpRequest
- java.lang.Object
-
- xin.manong.weapon.base.http.HttpRequest
-
public class HttpRequest extends Object
HTTP请求- 作者:
- frankcl
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classHttpRequest.Builder请求构建器
-
字段概要
字段 修饰符和类型 字段 说明 RequestFormatformatMap<String,String>headersRequestMethodmethodMap<String,Object>paramsStringrequestURL
-
构造器概要
构造器 构造器 说明 HttpRequest()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static HttpRequestbuildGetRequest(String requestURL, Map<String,Object> params)构建HTTP GET请求static HttpRequestbuildPostRequest(String requestURL, RequestFormat format, Map<String,Object> body)构建HTTP POST请求booleancheck()检测请求合法性 1.
-
-
-
字段详细资料
-
requestURL
public String requestURL
-
method
public RequestMethod method
-
format
public RequestFormat format
-
-
方法详细资料
-
buildGetRequest
public static HttpRequest buildGetRequest(String requestURL, Map<String,Object> params)
构建HTTP GET请求- 参数:
requestURL- 请求URLparams- 请求参数- 返回:
- HTTP请求
-
buildPostRequest
public static HttpRequest buildPostRequest(String requestURL, RequestFormat format, Map<String,Object> body)
构建HTTP POST请求- 参数:
requestURL- 请求URLformat- 请求格式body- 请求体- 返回:
- HTTP请求
-
check
public boolean check()
检测请求合法性 1. 请求URL不为空 2. 请求方式不为空 3. POST请求方式必须填写请求格式- 返回:
- 如果合法返回true,否则返回false
-
-