I have questions regarding the URL path format.
A url has a authority and a path. Now the question here is what is with an empty path (no path segments).
The following is considered.
Those two assumption would lead to the following results:
A. http.//domain?query, http.//domain#fraction, http.//domain would be legal URL strings
B. The following domain path would be extracted for the given domains.
- http.//domain -> segments = {}
- http.//domain/ -> segments = {''}
- http.//domain/a -> segments = {'a'}
- http.//domain/a/ -> segments = {'a', ''}
- http.//domain/a/b -> segments = {'a', 'b'}
- http.//domain/a/b/ -> segments = {'a', 'b', ''}
- http.//domain//// -> segments = {'', '', '', '', ''}`
Is this the correct interpretation?
PS: I used 'http.//' instead of 'http://' to avoid complains about illegal links.
That is correct. You can read the full URL specification (RFC 3986). Specifically section 3.3.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With