On Fri, May 19, 2017 at 6:46 PM, iaw4 <[email protected]> wrote: > $self->req->url->to_abs->host has the full URL request, such as > http://l4.l3.mysite.tld:3000/abc/def?x=123&y=456 . I can write my own > functions to decompose it, >
Don't do that. Use Mojo::URL <http://mojolicious.org/perldoc/Mojo/URL>. > but some already exist in M, such as $c->req->url (for > /abc/def?x=123&456). are there others? > Yes, see Attributes and Methods in Mojo::URL. > extracting l4.l3 (when localhost, presumably l4.l3.localhost:3000), 3000, > l4.l3.mysite.tld, etc. > Oh, it doesn't parse down a hostname for you. It wouldn't make sense to, there's no convention for that. > I looked at the http://mojolicious.org/perldoc/Mojo/URL , but I probably > do not understand how to read this. I tried to dumper $self->req->url, but > it does not list all defined functions. > Dumping $self->req->url wouldn't list all the functions, you need to read the reference manual <http://mojolicious.org/perldoc/Mojo/URL>. -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
