my code is as follows
//set factory
HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory();
factory.setConnectTimeout(500);
factory.setReadTimeout(3000);
//set headers
RestTemplate template = new RestTemplate(factory);
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setContentType(MediaType.APPLICATION_JSON_UTF8);
httpHeaders.set("Accept", "*/*");
httpHeaders.set("Accept-Charset", "utf-8");
,
this is the header information of the request. What I can"t understand is * * Why I overwrite Accept and Accept-Charset, but still write Accept-Charset in resttemplate, hoping someone can help me.