I need to redirect user to external url with POST data. How could I achieve this in ReactJS?
I need to redirect the user to external bank deposit link. I thought bank link will respond whit redirect url but it doesn't. My thinking is that I need to make a POST request to that bank link and redirect user to that page. Tell me if I'm wrong. Here is what I've tried so far.
This redirect happens in dispatch so rendering a form is not an option
fetch(body.success.message.redirect_url, {
method: "POST",
body: JSON.stringify(body.success.message.request_data)
})
.then(response => {
console.log(response);
})
.catch(error => {
throw error;
});