Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is my understanding and point of view about your question :</p> <blockquote> <p>Are these URI's a matter of a pure RESTful implementation vs implicit content negotiation?</p> </blockquote> <p>No, they are not part of any official documentation (that I know of), and are usually at the developper/team standards discretion. For example, <a href="http://framework.zend.com/" rel="nofollow">Zend Framework</a> 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.</p> <p>I have often seen <code>api</code> 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.</p> <blockquote> <p>Is this a matter of separating resource representations logically on the server side?</p> </blockquote> <p>More or less. For example, when performing a <code>PUT</code> 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 <em>the</em> view. So, for example, <code>http://domay.com/users/</code> would return the interface to manage users (or whatever), <code>http://domain.com/users/api</code> would perform operations and return interface updates (without a page reload).</p> <blockquote> <p>Am I missing a point?</p> </blockquote> <p>Weell, no. Since it is a design decision to use or not <code>api</code> in the URL, you're not missing anything here. With the proper headers, </p> <pre><code>http://domain.com/users/api/get http://domain.com/users/get http://domain.com/users/ </code></pre> <p>can all be valid RESTful requests.</p> <blockquote> <p>Why would someone design a RESTful API with 'API' in the URI?</p> </blockquote> <p>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.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload