A strange question about C/S URLRequest localization for C/S applications

Source: Internet
Author: User

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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.