public static void HttpRequestConfig(HttpRequestBase httpRequestBase,String param){
if(JsonUtil.isJsonString(param)||JsonUtil.isJsonArrayString(param)){
httpRequestBase.setHeader("Content-Type", "application/json, Consts.UTF_8");
}else{
httpRequestBase.setHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
}
httpRequestBase.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; …) Gecko/20100101 Firefox/72.0");
}
http请求header配置
最新推荐文章于 2023-11-20 16:19:04 发布