How to get the serialized URL in Node.js

1 Answer

0 votes
const url = require('url');

const testurl = new URL('https://www.website.com/index.html?id=8372&age=43')

console.log(testurl.href);
  
  
       
/*
run:
     
https://www.website.com/index.html?id=8372&age=43
   
*/

 



answered Mar 10, 2020 by avibootz
edited Mar 10, 2020 by avibootz

Related questions

1 answer 221 views
3 answers 280 views
1 answer 242 views
242 views asked Mar 10, 2020 by avibootz
1 answer 224 views
1 answer 275 views
3 answers 380 views
...