Need help to understand URI

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

On Thu, Sep 17, 2009 at 6:47 AM, Hunt J. [email protected]
wrote:

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

RFC 2396: Uniform Resource Identifiers (URI): Generic Syntax
http://www.ietf.org/rfc/rfc2396.txt

:: would probably be a good place to start :slight_smile:

On Thu, Sep 17, 2009 at 11:00 PM, Hassan S.
[email protected] wrote:

On Thu, Sep 17, 2009 at 6:47 AM, Hunt J. [email protected] wrote:

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

RFC 2396: Uniform Resource Identifiers (URI): Generic Syntax
http://www.ietf.org/rfc/rfc2396.txt

:: would probably be a good place to start :slight_smile:

Looks very helpful.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs