Skip to main content
added 6 characters in body
Source Link

Update 2021: i tried url.format and querystring and both of them are deprecated, instead we can use URLSearchParams

const {URLSearchParams} = require('url') app.get('/category', (req, res) =>{ const pathname = '/?' const components ={   a:"a",   b:"b"  } const urlParameters = new URLSearchParams(components) res.redirect(pathname + urlParameters) }) 

Update 2021: i tried url.format and querystring and both of them are deprecated, instead we can use URLSearchParams

const {URLSearchParams} = require('url') app.get('/category', (req, res) =>{ const pathname = '/?' const components ={ a:"a", b:"b" } const urlParameters = new URLSearchParams(components) res.redirect(pathname + urlParameters) }) 

Update 2021: i tried url.format and querystring and both of them are deprecated, instead we can use URLSearchParams

const {URLSearchParams} = require('url') app.get('/category', (req, res) =>{ const pathname = '/?' const components ={   a:"a",   b:"b"  } const urlParameters = new URLSearchParams(components) res.redirect(pathname + urlParameters) }) 
added 1 character in body
Source Link

Update 2021: i tried url.format and querystring and both of them are deprecated, instead we can use URLSearchParams

const {URLSearchParams} = require('url') app.get('category''/category', (req, res) =>{ const pathname = '/?' const components ={ a:"a", b:"b" } const urlParameters = new URLSearchParams(components) res.redirect(pathname + urlParameters) }) 

Update 2021: i tried url.format and querystring and both of them are deprecated, instead we can use URLSearchParams

const {URLSearchParams} = require('url') app.get('category', (req, res) =>{ const pathname = '/?' const components ={ a:"a", b:"b" } const urlParameters = new URLSearchParams(components) res.redirect(pathname + urlParameters) }) 

Update 2021: i tried url.format and querystring and both of them are deprecated, instead we can use URLSearchParams

const {URLSearchParams} = require('url') app.get('/category', (req, res) =>{ const pathname = '/?' const components ={ a:"a", b:"b" } const urlParameters = new URLSearchParams(components) res.redirect(pathname + urlParameters) }) 
Source Link

Update 2021: i tried url.format and querystring and both of them are deprecated, instead we can use URLSearchParams

const {URLSearchParams} = require('url') app.get('category', (req, res) =>{ const pathname = '/?' const components ={ a:"a", b:"b" } const urlParameters = new URLSearchParams(components) res.redirect(pathname + urlParameters) })