MCPcopy Create free account
hub / github.com/SeanDragon/protools / HttpSend

Class HttpSend

http/src/main/java/pro/tools/http/pojo/HttpSend.java:13–131  ·  view source on GitHub ↗

@author SeanDragon Create By 2017-07-20 13:50

Source from the content-addressed store, hash-verified

11 * Create By 2017-07-20 13:50
12 */
13public class HttpSend {
14 /**
15 * 地址
16 */
17 private String url;
18 /**
19 * 传入的参数
20 */
21 private Map<String, Object> params;
22 /**
23 * header列表
24 */
25 private Map<String, Object> headers;
26 /**
27 * 访问方法
28 */
29 private HttpMethod method;
30 /**
31 * 编码
32 */
33 private Charset charset;
34 /**
35 * 是否需要返回header列表
36 */
37 private Boolean needReceiveHeaders;
38
39 public HttpSend(String url) {
40 init();
41 this.url = url;
42 }
43
44 public HttpSend(String url, Map<String, Object> params) {
45 init();
46 this.url = url;
47 this.params = params;
48 }
49
50 public HttpSend(String url, Map<String, Object> params, HttpMethod method) {
51 init();
52 this.url = url;
53 this.params = params;
54 this.method = method;
55 }
56
57 public static HttpSend of(String url) {
58 return new HttpSend(url);
59 }
60
61 public static HttpSend of(String url, Map<String, Object> params) {
62 return new HttpSend(url, params);
63 }
64
65 public static HttpSend of(String url, Map<String, Object> params, HttpMethod method) {
66 return new HttpSend(url, params, method);
67 }
68
69 /**
70 * 初始化

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected