Reputation: 1768
I'm learning Web tech and teacher cannot give me a satisfactory explanation. I'd like to give a few example, please help me to point out am I right.
a/b/c.txt?t=win&s=chess
is request-URIpara5
does not belong to the request-URI is just a fragmentUpvotes: 16
Views: 93201
Reputation: 11
For someone looking for example of how an endpoint will results in URL and URI in tomcat like servers,
If this is your ENDPOINT: https://localhost:8443/admin/index.jsp?action=home
Request-URL will be : "https://localhost:8443/admin/index.jsp"
Request-URI will be : "/admin/index.jsp"
URL -> is the resource (index.jsp) locator to locate a page across pages in web.
URI -> is an identifier of the resource (index.jsp) within App domain.
Basically both is resolving the index.jsp in different contexts.
Upvotes: 1
Reputation: 8751
The term "Request-URI" is defined by the HTTP standard (RFC 2616, §5.1.2), and refers to the URL as it is given in the actual HTTP request.
In normal HTTP requests, the URL scheme and host have already been handled by the time the request is sent (and the URL fragment does not exist at the HTTP protocol level at all), meaning the Request-URI is a path-absolute-URL string, possibly followed by ?
and a URL-query string.
That is to say, this part of the complete URL:
https://example.org/path/to/file?param=42#fragment
^^^^^^^^^^^^^^^^^^^^^^
Note that it includes the leading /
.
Exceptions to this include:
OPTIONS
HTTP method, the Request-URI may simply be *
.Upvotes: 16
Reputation: 329
I know it's an old topic, but I came across it on my current research, maybe others will have related issues:
You can find the term "Request_URI" in the apache server language, I don't know if that was ment... Here it would be similiar to "Path", i.e. used to lock the access via .htaccess to a specific URL somehow like this:
URL: www.example.de/lockthissite/
.htaccess code:
SetEnvIfNoCase Request_URI ^/lockthissite/$ SECURED=yes
AuthType Basic
AuthName "restricted access"
AuthUserFile /path/to/my/.htpasswd
Require valid-user
Satisfy any
Order allow,deny
Allow from all
Deny from env=SECURED
Upvotes: -3
Reputation: 96737
The URI standard is STD 66, which currently maps to RFC 3986.
Section 1.1.3 describes the difference between URIs and URLs (and URNs).
Section 3 describes the components a URI can have.
For the URI http://www.example.org:56789/a/b/c.txt?t=win&s=chess#para5
these would be:
Scheme: http
Authority: www.example.org:56789
User Information: not present
Host: www.example.org
Port: 56789
Path: /a/b/c.txt
Query: t=win&s=chess
Fragment: para5
The term "request-URI" is not defined or even used in STD 66 / RFC 3986.
Upvotes: 21