I have a ReSTful web service that needs to parse locale-dependent data from a request. This data can be either in an XML element or in part of a query string. Is there any way to determine in which locale the data is sent (and by extension the locale to which the response should be sent)?
One option is to simply tell clients the locale where all requests should be sent. The friendly option seems to allow the client to specify the locale.
I thought:
a) using the accept http header to encode this information.
b) using the xml: lang attribute for XML POST and an additional field for query strings (e.g. ... & locale = en-GB)
http://www.w3.org/International/questions/qa-accept-lang-locales warns of restrictions on the use of the accept-language header, but most of the warnings seem to be centered around requests coming from browsers. In my case, the requests will be come from other applications.
All tips are greatly appreciated!
Akash source share