Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

URL resolve (operations on path etc.)

by bliako (Monsignor)
on Jul 31, 2022 at 07:37 UTC ( [id://11145863]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    const url = require('url');
    const x = 'http:/a.com/a/b/c/d/e.json?x=1&y=2';
    const y = '../../../';
    console.log(url.resolve(x, y));
    
  2. or download this
    use URI;
    my $x = 'http:/a.com/a/b/c/d/e.json?x=1&y=2';
    ...
    print $u;
    <c>
    <p>With this result: <c>http:/a.com/a/b/c/d/e.json/../../../?x=1&y=2
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11145863]
Approved by haukex
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-23 15:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found