When doing localization, in order to cooperate with the content Localization on the server side, you need to obtain the current language environment from the client and tell the server side. We set the accept-language attribute in the Request Header whenever a request is initiated, so that the server can directly extract and judge against each other without adding a field.
However, in iOS, The setvalue of nsmutableurlrequest is called:When the forhttpheaderfield method is used, no matter how this language attribute is set, the language cannot be changed when the server receives the request header for language extraction. For example: it was successively set to ZH-CN and en-GB, and the server caught them all in ZH-CN. At first, I thought the settings were wrong and I had no clue when I searched for them for a long time, later, I tried to change the local language environment of a device and found that the language of the request header was controlled by the current language environment of the iPhone, what language is the header captured on the server. It is strange that this property is blocked by Apple? Cannot be modified?