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 6214467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:52:53+00:00 2026-05-24T06:52:53+00:00

I just finished reading Restful Web Services and Nobody Understands REST or HTTP and

  • 0

I just finished reading Restful Web Services and Nobody Understands REST or HTTP and am trying to design an API with a RESTful design.

I’ve noticed a few patterns in API URI design:

http://api.example.com/users
http://example.com/api/users
http://example.com/users

Assume that these designs properly use Accept and Content-type headers for content negotiations between XHTML, JSON, or any format.

Are these URI’s a matter of a pure RESTful implementation vs implicit content negotiation?

My thoughts are that by explicitly using API in the URI is so that a client will expect a data format that is not inherently human pleasing hypermedia and can be more easily consumed without explicitly setting an Accept header. In other words, the API is implying that you expect JSON or XML rather than XHTML.

Is this a matter of separating resource representations
logically on the server side?

The only justification I can come up with for why someone would design their URI’s with an API subdomain is because, based off my assumption that this is a scaling technique, it should make routing request load easier in a multi-tiered server infrastructure. Maybe situations exist where reverse proxies are stripping the headers? I don’t know. Different servers handling different representations?

Maybe a subdomain is used for external consumers only so that the server avoids the overhead from internal usage. Rate limiting?

Am I missing a point?

My proposed design would attempt to follow RESTful practices by setting appropriate headers, using HTTP verbs appropriately and representing resources in a fashion that I feel including ‘API’ in the URI would be redundant.

Why would someone design a RESTful API with ‘API’ in the URI?

Or could they? Maybe my problem with not understanding this design is that it doesn’t matter as long as it follows some combination of specification which may not lead to a RESTful API implementation but close? There is more than one way to skin a keyboard cat.
HATEOAS related?


Update: While researching this topic I have come to the conclusion that it’s important to consider ideas from REST but not to treat it as a religion. Thus, whether or not to have ‘api’ in the URI is more of a design decision than a steadfast rule. If you plan to expose your website’s API publicly it would be a good idea to use an api subdomain to help deal with the application’s logic. I hope that someone will contribute their insight for others to learn from.

  • 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-24T06:52:54+00:00Added an answer on May 24, 2026 at 6:52 am

    This is my understanding and point of view about your question :

    Are these URI’s a matter of a pure RESTful implementation vs implicit
    content negotiation?

    No, they are not part of any official documentation (that I know of), and are usually at the developper/team standards discretion. For example, Zend Framework uses some utility classes to detect XHR requests and how responses should be returned. Granted, ZF is not pure RESTful design (or most PHP application as a matter of fact), but it is still possible to write such designs even in PHP.

    I have often seen api being used in urls when the returned data expected is indeed not meant to be used as is for display to the end user. However it is usually a design decision and not necessarily an implied standard.

    Is this a matter of separating resource representations logically on
    the server side?

    More or less. For example, when performing a PUT request, for example, the interface does not necessarily need to be entirely refreshed, and often a simple response message is good enough. While this response message is part of the view, it is not the view. So, for example, http://domay.com/users/ would return the interface to manage users (or whatever), http://domain.com/users/api would perform operations and return interface updates (without a page reload).

    Am I missing a point?

    Weell, no. Since it is a design decision to use or not api in the URL, you’re not missing anything here. With the proper headers,

    http://domain.com/users/api/get
    http://domain.com/users/get
    http://domain.com/users/
    

    can all be valid RESTful requests.

    Why would someone design a RESTful API with ‘API’ in the URI?

    Simply put, to have an URL naming convention. So that, when looking at a request in logs, documentation, etc. One will understand it’s purpose.

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

Sidebar

Related Questions

Just finished reading this blog post: http://www.skorks.com/2010/03/an-interview-question-that-prints-out-its-own-source-code-in-ruby/ In it, the author argues the case
I've just finished reading Domain Driven Design and I'm enchanted with some of the
I've just finished reading Domain-driven design: tackling complexity in the heart of software by
Just finished reading Jon Skeet's article about events and delegates and got a question.
I just finished reading this post: https://developer.yahoo.com/performance/rules.html#flush and have already implemented a flush after
I just finished reading this article on the advantages and disadvantages of exceptions and
I just finished reading a book on scala. What strikes me is that every
I just finished reading about scoping in the R intro , and am very
I just finished reading the Functions chapter from Uncle Bob's Clean Code . The
I've just finished reading Roy Osherove's The Art of Unit Testing and I am

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.