Need help to understand URI

H

Hunt Jon

I'm trying to understand different parts of a URI.

URI#parse() uses URI#split(). But I don't understand which
component is which.

There are nine components.

scheme, userinfo, host, port,
registry, path, opaque, query, fragment

I can guess some of the above.
But I'm not sure about others.

I tracked down the variable @regexp[:ABS_URI] and @regexp[:REL_URI]
in split(), but

scheme is http://, ssh://
userinfo is matz:
host is exampe.com
port is :80
registry (I have no idea)
path is /path/to/file/or/dir (does this include file name as well?)
opaque (I have no idea)
query (?s=hello&?q=goodbye)


uri/common.rb has a bunch of Regexp constants, which I find it
difficult to understand.

If you could give me a general help on the list above (e.g., if I'm
wrong or missing something),
I could play at http://rubular.com/ to play more with URI.

Any help would be appreciated.

Jon Hunt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top