Is there a way to handle POST
requests using the react-router-dom
(npm) library?
Why? The payment gateway will redirect the user, who successfully payed, back to the platform. I can use a GET
or POST
request to transfer data with the redirection page. But I don't like having the data visible in the URL. Other options are always welcome, I'm using a REST API (Node.JS, Express) and a website/dashboard (ReactJS)
I get what you're after but you can't POST
to the browser. If you're uncomfortable passing data as GET
params in a URL, you could:
fetch()
(or your favorite data-grabbing util).Since you're in a React world, I'd recommend the third option here. How to fetch data, build an API endpoint, store data, then display it goes well beyond the scope of this question so I'd suggest some Googling. Here's a starting point: https://code.tutsplus.com/tutorials/introduction-to-api-calls-with-react-and-axios--cms-21027
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With