Please enable JavaScript.
Coggle requires JavaScript to display documents.
Building a multilingual RESTful API - Coggle Diagram
Building a multilingual RESTful API
Request
:check:
Option 1
: language negotiation via the
Accept-Language
header
Pros
Fully RESTful
One single resource address, no matter how many languages you have
Cons
Makes it harder to test and retrieve different languages via the browser
:red_cross:
Option 2
: language negotiation via URL
Pros
Very easy to use and test (requests can be easily performed in the web browser)
Cons
Multiple addresses for one single resource
Not fully RESTful (since elements are added to the URL which are not part of the resource path in REST meaning)
Wildcard (/*/resource) is impossible
:check:
Option 3
: language negotiation via query parameter
Pros
One single resource address, no matter how many languages you have
Easy to use and test
Possible to use a wildcard (language=*) to display the same resource in multiple languages
Cons
?
Response
:red_cross: use language as an object attribute
:check: add language as another field