3

I am having this simple POST url to which my clients will send a POST request.

http://mydomain.com/requests/request

POST Data:

<Request>
<OrderId>1E008921</OrderId>
<OrderName>MC1</OrderName>
</Request>

to which I respond by sending back them a XML

<SRequest>
<RequestedBy>Client 1 </RequestedBy>
<RequestName>Test Name</RequestName>
<RequestStatus>Success</RequestStatus>
<SRequest>

Now client wants the above XML in a different language (say French)

How to handle this ? How to send the response language preference in Web API ? specially with the POST scenario like this ? (Append a language string ? or what is the best practices ?)

  • 2
    Unsure if you've seen it, but there is a site from Microsoft on internalizaion: http://www.asp.net/mvc/overview/internationalization - it may be a big help – Robert H Jun 05 '14 at 12:55

1 Answers1

2

I suggest you either include it in URL: http://mydomain.com/fr/requests/request or use HTTP header like Accept-Language. You could read more in the answer to: Good way to changing language resources dynamically by request

Community
  • 1
  • 1
artplastika
  • 1,972
  • 2
  • 19
  • 38