如何将HTML表单输入作为JSON重定向到API网关

问题描述

我正在尝试构建将接受“用户名”和“电子邮件”作为输入的Web表单。提交后,我需要将该输入以json格式发送到AWS API网关。但是无法通过HTML将json发送到action = api网关链接

这就是我想要做的:

          <form id="launch-form" class="slides-form" action="https://test.execute-api.us-east-1.amazonaws.com/test/" method="post">
        <input type="text" class="rounded input-9 ae-4 fromCenter" name="name" value = "username" placeholder="username"/>
        <input type="email" class="rounded input-9 ae-6 fromCenter" name="user-email" value="email" placeholder="Email"/>
        <button type="submit" class="button blue rounded button-9 ae-7 fromCenter" name="button">Launch</button>

我可以访问URL,但不能发送json格式。我将如何实现这一目标?

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)