是否可以通过不受控制的组件提交表单数据?

时间:2019-08-25 06:39:43

标签: html node.js reactjs

我正在尝试将paytm网关添加到我的react应用程序。 这是服务器上的POST路由

/api/payment

它呈现自己的html。 因此,我必须使用表单数据重定向到它。 而不是异步请求。

<form method="POST" action="http://localhost:8000/api/payment">
  <input type="text" name="total" value="1200.00" hidden/>
      <Button>
        Proceed To Pay
   </Button>
</form>
app.post('/api/payment',(req,res)=>{
console.log(req.value);//=>undefined expected=>1200.00
console.log(req.body); //=>{}
...

0 个答案:

没有答案