Python 如何模拟HTML<-&燃气轮机;与cURL的FLASK交互-POST请求

Python 如何模拟HTML<-&燃气轮机;与cURL的FLASK交互-POST请求,python,html,flask,curl,post,Python,Html,Flask,Curl,Post,我在docker中运行一个flask应用程序,它有一个简单的HTML表单: <form action = "http://localhost:8080/post_it" method ="post"> Type something: <input type="text" value="type..." name="n"/>

我在docker中运行一个flask应用程序,它有一个简单的HTML表单:

      <form action = "http://localhost:8080/post_it" method ="post">
         Type something:
        <input type="text" value="type..." name="n"/>
        <input type="submit" value="SAVE"/>      
      </form>
这完全符合预期。这是烧瓶容器中的日志:

[日志:][1]

[24/May/2021 06:36:32] "POST /post_to_psql_db HTTP/1.1" 302 -
[24/May/2021 06:36:32] "GET / HTTP/1.1" 200 -
[24/May/2021 06:36:33] "POST /post_to_psql_db HTTP/1.1" 302 -
但是当我尝试模拟与cURL请求的交互时,比如:

curl -X POST "localhost:8080/post_it"
我得到的只是:

[24/May/2021 06:38:58] "POST /post_to_psql_db HTTP/1.1" 400 -
[24/May/2021 06:38:59] "POST /post_to_psql_db HTTP/1.1" 400 -
[24/May/2021 06:39:00] "POST /post_to_psql_db HTTP/1.1" 400 -
[日志2][2]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>400 Bad Request</title>
<h1>Bad Request</h1>
<p>The browser (or proxy) sent a request that this server could not understand.</p>

400错误请求
错误的请求
浏览器(或代理)发送了此服务器无法理解的请求

cURL请求或flask函数是否有问题?也许是别的什么? [1]:
[2] :

302 HTTP代码通常表示您向HTTP发出了请求,它希望重定向到HTTPS版本。它并不意味着任何方面的成功,200-299 HTTP代码意味着成功。此外,您只允许一个请求方法,所以为什么要检查它是什么方法,flask将在内部处理它。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>400 Bad Request</title>
<h1>Bad Request</h1>
<p>The browser (or proxy) sent a request that this server could not understand.</p>