fix(API): 去掉默认 http client 请求头

This commit is contained in:
taojinlong 2022-07-01 17:43:29 +08:00
parent 94871bdbc3
commit 8d13c10d97

View File

@ -86,9 +86,6 @@ public class HttpClientUtil {
for (String key : header.keySet()) {
httpGet.addHeader(key, header.get(key));
}
httpGet.addHeader(HTTP.CONTENT_ENCODING, config.getCharset());
HttpResponse response = httpClient.execute(httpGet);
return getResponseStr(response, config);
} catch (Exception e) {
@ -124,9 +121,6 @@ public class HttpClientUtil {
for (String key : header.keySet()) {
httpPost.addHeader(key, header.get(key));
}
httpPost.addHeader(HTTP.CONTENT_TYPE, "application/json");
httpPost.addHeader(HTTP.CONTENT_ENCODING, config.getCharset());
EntityBuilder entityBuilder = EntityBuilder.create();
entityBuilder.setText(json);
entityBuilder.setContentType(ContentType.APPLICATION_JSON);
@ -180,8 +174,6 @@ public class HttpClientUtil {
for (String key : header.keySet()) {
httpPost.addHeader(key, header.get(key));
}
httpPost.addHeader(HTTP.CONTENT_ENCODING, config.getCharset());
if (body != null && body.size() > 0) {
List<NameValuePair> nvps = new ArrayList<>();
for (String key : body.keySet()) {