Parameters in Path Segments of URL

Vitaly

There is one interesting thing in URL format:
Parameters in Path Segments of URL.

For more information see section "2.2.5" in
"O'Reilly - HTTP - The Definitive Guide".

This book can be found freely in Internet.

or in official specification https://www.ietf.org/rfc/rfc2396.txt section 3.3.

3.3. Path Component

The path component contains data, specific to the authority (or the scheme if there is no authority component), identifying the resource
within the scope of that scheme and authority.

  path          = [ abs_path | opaque_part ]

  path_segments = segment *( "/" segment )
  segment       = *pchar *( ";" param )
  param         = *pchar

  pchar         = unreserved | escaped |
                  ":" | "@" | "&" | "=" | "+" | "$" | ","

Let's consider the following URL:

http://www.example.com/first-segment/second-segment/index.html?type=HelloWorld

Here /first-segment/second-segment/index.html is a Path part of URL.

  1. And first-segment is a first segment of that Path
  2. second-segment is a second segment of that Path
  3. index.html is a third segment of that Path

It is stated in that book that each segment could have individual Parameters separated by semicolon ";". In our example it could be:

http://www.example.com/first-segment;f1=WWW/second-segment;s1=1;s2=2/index.html;i1=100;abc=200?type=HelloWorld
  1. Here f1 - parameter for first-segment
  2. s1 and s2 - parameters for second-segment
  3. i1 and abc parameters for index.html

The question is: do you know any practical examples of such Parameters in URLs?

Martin Prikryl

I do not know any example of exactly parameters in the path segment.

But close example is connection and SFTP parameters in (expired) SFTP URL proposal.

There's one proposed connection parameter, the fingerprint for SSH host key fingerprint:

sftp://username:password;[email protected]/

And one proposed SFTP parameter, the typecode for transfer mode (ascii vs. binary). There's no official example, but it should be like:

sftp://username:[email protected]/path/file;typecode=i

(what actually, while semantically different, has the syntax of your "path" parameter)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Is there a way to work with parameters in URL path segments in ASP Net/ASP Net Core

How to capture multiple URL parameters / segments?

Regex to match URL path segments not containing a symbol

Conditional redirect in .htaccess depending on the number of path segments in the URL

.htaccess remove URL path segments that are causing an Internal Server Error

Nginx rewrite - Remove path segments from URL for static assets?

Pagination with URL path or the query parameters

URL path parameters vs query parameters in Django

Path does not coincide with Segments

Regex[Python] Extract from url path parameters

Setting dynamic link path with url parameters in rails

AWS API Gateway with dynamic URL path parameters

Make Wildfly decode URL Path Parameters

Swagger (spray) path parameters inside resource url

JQuery AJAX URL Rest path parameters

Rest URL Standards - Multiple Path Parameters

Testing DRF GenericViewSet with parameters in url_path

Error passing multiple route parameters in a url path

Match folder in URL path but exclude parameters

Must path parameters always come at the end of the URL?

iOS: parse a URL into segments

Rewrite subdomain and URL-path to URL parameters but allow access to files

Optional path segments in Spring MVC

Wiremock not templating request path segments

Rewrite URL containing directory path and parameters to parameter based URL using both path and query string

Configure .htaccess to process segments of the URL

Working with multiple url segments codeigniter

how to use URI templates to change path parameters in a URL in java

How to summarize requests by url with path parameters using Kusto