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");
|
}
|
}
|
|
}
|