Van333
2022-12-29 d8f66b834134f6b755fd3fb93bb91b56f9d31f6f
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
package api.utils;
 
import lombok.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
 
import java.util.HashMap;
 
/**
 * @author van
 * @version 1.0
 * msg:
 * @date 2022/6/6 15:01
 */
@Data
public class CommonHeader extends HashMap<String, String> {
 
    private static Logger logger = LoggerFactory.getLogger(CommonHeader.class);
 
    public static final String FORM = "form";
    public static final String JSON = "json";
 
    public CommonHeader(String type,boolean hasToken){
        if(type.equals(FORM)) {
            super.put("Content-Type","application/x-www-form-urlencoded");
        } else if(type.equals(JSON)) {
            super.put("Content-Type","application/json");
        }
        }
 
}