Specifying culture for http request/reponse

Posted by Akash on Stack Overflow See other posts from Stack Overflow or by Akash
Published on 2010-03-17T19:38:42Z Indexed on 2010/03/17 19:41 UTC
Read the original article Hit count: 493

I have a ReSTful web service which needs to parse culture-sensitive data from the request. This data could either be in an XML body or part of the query string. Is there any acepted way of determining which culture the data is being sent in (and by extension the culture in which the response should be sent)?

One option is simply to specify to the clients the culture in which all requests should be sent. A friendlier option seems to be to allow the client to specify the culture.

I've considered:

a) using the accept-language http header to encode this information.

b) using the xml:lang attribute for XML POSTs, and an extra field for query strings (e.g. ...&culture=en-GB)

http://www.w3.org/International/questions/qa-accept-lang-locales warns of limitations in using the accept-language header, but most of the warnings seem to center around requests originating from browsers. In my case the requests will come from other applications.

All advice greatly appreciated!

© Stack Overflow or respective owner

Related posts about rest

Related posts about restful