Reputation: 11
When user hits my end point it has to be redirected to an external URL with url encoded form parameters.
name:testing, id: 123456
This is what I tried for now in Express. It gets redirected to the URL but I don't know how to add parameters.
app.get('/', (req, res) => res.redirect(302,'https://example.com'))
Upvotes: 0
Views: 1448
Reputation: 253
You can't redirect with parameters as a POT request.
You have 2 options:
add parameters to query string:
Example: https://example.com/?ParameterOne='xxx'
use res.render
, with parameters and use the following through the view engine u use.
Example: res.render('index', {parameterOne: xxx})
Upvotes: 1