Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is an excellent question. I have checked <a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm" rel="nofollow">Fielding's chapter on REST</a>, the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616.html" rel="nofollow">HTTP spec</a> and the <a href="http://www.ietf.org/rfc/rfc2617.txt" rel="nofollow">Basic auth RFC</a> and can't seem to find a definitive answer, but my best guess it that the authentication portion of the URI is not considered a part of resource identification. Meaning that you should pretend it is not there and use:</p> <pre><code>//site.com/users/test/ </code></pre> <p>As the URI for a single user. Here is my reasoning.</p> <ol> <li><p>Browser implementation - The auth portion of the URI (test:password@) is automatically hidden in my current versions of Chrome and Firefox and <a href="http://support.microsoft.com/kb/834489" rel="nofollow">Internet Explorer denies direct input outright</a>.</p></li> <li><p>If the user:password@ portion made the resource URI unique, then every resource for every user would be unique. That just seems a little crazy overboard to me.</p></li> <li><p>You would never, ever want to include a username and password in an external reference like this:</p></li> </ol> <p><code>&lt;a href="https://admin:swordfish@site.com/users/"&gt;Log in as admin!&lt;/a&gt;</code></p> <p>It seems to me that including authentication information in the URL is a hack that breaks statelessness and violates the first REST interface constraint (<a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#sec_5_2_1_1" rel="nofollow">Identification of resources</a>) but it fills and need so we sweep it under the rug and pretend that it is not really part of the URL.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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