1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
| package com.ruoyi.common.utils.http;
|
| import java.util.HashMap;
| import java.util.Map;
|
| public class HttpEntity<T> {
|
| /**
| * 空的报文头
| */
| public static final Map<String, String> EMPTY_HEADERS = new HashMap<String, String>(0);
|
| /**
| * 报文头
| */
| private final Map<String, String> headers;
|
| /**
| * 报文体
| */
| private final T body;
|
| public HttpEntity(Map<String, String> headers, T body) {
| this.headers = headers;
| this.body = body;
| }
|
| public HttpEntity(T body) {
| this.headers = EMPTY_HEADERS;
| this.body = body;
| }
|
| public Map<String, String> getHeaders() {
| return headers;
| }
|
| public T getBody() {
| return body;
| }
| }
|
|