Multilingual RESTful web API resources

If your RESTful web API needs to return the resource representations in different languages depending upon the client locale, use the content negotiation offering in HTTP:

  • Clients can use the Accept-Language request header to specify language preferences.
  • While generating a response, the server is expected to translate the messages into the language supported by the client. The server can use the Content-Language entity-header field to describe the natural language(s) of the intended audience.

Get RESTful Java Web Services - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.