Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's a good name for the part of a URL after the hostname? [closed]

Tags:

url

naming

I'm parsing a path string containing everything after the hostname, meaning the path, query, and fragment. Previously, I was calling this whole chunk the path in a function parseUrlPath, but that's a bit confusing, since I'm calling both the inner part and the whole thing the path

Maybe it's not the worst idea... I mean, we use the word "server" for both the machine itself and the program running on that machine. But does anyone have an idea? Or even better, a reference citing an existing name for the path/query/fragment?

like image 937
Chris Middleton Avatar asked Sep 15 '25 20:09

Chris Middleton


1 Answers

URI.js calls the function path() for getting/setting the path and resource() for setting the part of the URI "comprising of path, query, and fragment."

Given the URI https://[email protected]:8080/foo/bar.html?q=3#baz:

path() === '/foo/bar.html'
query() === 'q=3'
resource() === '/foo/bar.html?q=3#baz'

This might be useful: https://medialize.github.io/URI.js/docs.html

like image 62
rink.attendant.6 Avatar answered Sep 19 '25 15:09

rink.attendant.6