11

A URI is composed of several parts: scheme:[//[user[:password]@]host[:port]][/path][?query][#fragment]. Often, I find myself wanting to refer to the entire part of the URI to the right of the host and port - the part that would be considered the URI in an HTTP request:

GET /path?query#fragment
Host: example.com

As a short-hand, I normally call this the "path", but that's not quite accurate, as the path is only part of it. This is essentially the inverse of What do you call the entire first part of a URL?

Is there an agreed-upon name for this?

Xiong Chiamiov
  • 13,076
  • 9
  • 63
  • 101

3 Answers3

5

Within a full HTTP URI, there doesn’t seem to be a term that denotes everything coming after the authority.

If you only have the part in question as a URI reference (e.g., in a HTTP GET request), it’s called a relative reference:

relative-ref  = relative-part [ "?" query ] [ "#" fragment ]

But this term also includes network-path references (often called protocol-relative URIs), e.g. //example.com/path?query#fragment. To exclude this case, you could use the terms for the other two cases:

  • absolute-path reference (begins with a single /, e.g. /path?query#fragment)
  • relative-path reference (doesn’t begin with a /, e.g., path?query#fragment

¹ If the first path segment contains a :, you have to begin the relative-path reference with ./ (e.g., ./pa:th?query#fragment).

Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360
2

RFC 7230 says:

request-line = method SP request-target SP HTTP-version CRLF

I personally prefer to use the terms

  • origin for scheme and authority (where) and
  • resource for path, query string and fragment (what).
Community
  • 1
  • 1
Max
  • 21
  • 1
0

I'm not aware of any term for that portion of a URI.

RFC3986 says this

     foo://example.com:8042/over/there?name=ferret#nose
     \_/   \______________/\_________/ \_________/ \__/
      |           |            |            |        |
   scheme     authority       path        query   fragment
      |   _____________________|__
     / \ /                        \
     urn:example:animal:ferret:nose
Community
  • 1
  • 1
Darrel Miller
  • 139,164
  • 32
  • 194
  • 243