Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do we call the combined path, query, and fragment in a URI?

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?

like image 222
Xiong Chiamiov Avatar asked Nov 29 '17 01:11

Xiong Chiamiov


People also ask

Can a URL have multiple fragments?

Note that multiple text fragments can appear in one URL. The particular text fragments need to be separated by an ampersand character & .

Does URI include query string?

There is no protocol information given in URI. It contains components such as protocol, domain, path, hash, query string, etc. It contains components like scheme, authority, path, query, fragment component, etc. Not all URIs are URLs since a URI can be a name instead of a locator.

What is path fragment?

– A maximal path fragment is a path that cannot be. prolonged, i.e., it is either infinite or ends in a state, sfinal, in which Post(sfinal) is empty (terminal state) – A path is initial if its first state is an initial state.

What is HTTP path?

Most servers use the well-known port numbers for HTTP and HTTPS , so most HTTP URLs omit the port number. A path. The path identifies the specific resource in the host that the web client wants to access. For example, /software/htp/cics/index. html .


2 Answers

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).

like image 155
unor Avatar answered Oct 03 '22 03:10

unor


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).
like image 36
Max Avatar answered Oct 03 '22 05:10

Max