Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6835865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:17:03+00:00 2026-05-26T23:17:03+00:00

Is there a REST best practice for GETting resources in different languages. Currently, we

  • 0

Is there a REST best practice for GETting resources in different languages. Currently, we have

www.mysite.com/books?locale=en

I know we can use the accept-language header but is it better for us to do

www.mysite.com/books/en or www.mysite.com/books.en

or does it not matter?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:17:04+00:00Added an answer on May 26, 2026 at 11:17 pm

    I think best way would be to implement this following way:

    1. HTTP’s Accept-Language header
    2. Language prefix in URI such as /en/books/…

    In other words you can accept language from both sources. Implementation will be following:

    1. Check if Accept-Language header is provided and keep this in the variable;
    2. If request URI starts with /en, /fr or other known language codes(that are supported by your system) Overwrite language variable with this new value, strip it from URI i.e. if URI is /en/books you will end up with /books.
    3. If there is no language provided, keep default language in variable for example “en”

    With this approach you can make sure that a) path routing will be language agnostic and your system will work uniformly with paths; b) language handling/negotiation will be completely separated from your scripts. You can use language information in your scripts without even knowing what was the source and how it was requested.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way in Cocoa that is currently considered best practice for creating
Are there any known how-tos or best practices for web service REST API versioning?
OK so I have a few operations for my REST Web Service. There is
I just have a quick best practice question regarding custom cells in a UITableView.
So I have a question regarding the best practice for a PHP page inserting
Is there a best-practice for scalable http session management? Problem space: Shopping cart kind
If there is a REST resource that I want to monitor for changes or
Is there a JavaScript library which allow me to perform all the REST operation
There is ASMX, WCF, REST, and ADO.NET Data Services... I've used WCF and ASMX
There is a talk here by Stefan Tilkov , where he is describing REST

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.