The problem of RestTemplate Accept-Charset in java

< H2 > Accept-Charset has a lot of character encoding and takes up a lot of space. < / H2 >

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

clipboard.png

clipboard.png,
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.

Mar.10,2021

whether you use the content converter StringHttpMessageConverter, if you do, you need to set
stringHttpMessageConverter.setWriteAcceptCharset (false);
for your settings to take effect

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e8b17f-1027.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e8b17f-1027.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?