无法理解 cURL 命令 POST

Cannot figure out a cURL command POST

我一直在尝试弄清楚如何使用 cURL 从 Web 域中获取信息 https://www.dnsleaktest.com/

这个网站上有两个按钮,一个是标准测试,另一个是扩展测试。我想让 cURL 从 or 输出所有数据。

这是常规 cURL 命令的输出..

<form action="results.html" method="POST">
  <input type="submit" class="standard" name="standard" value="Standard test"></input>
  <input type="submit" class="enhanced" name="enhanced" value="Extended test"></input>

有哪位 cURL 专家可以就此给我建议吗?非常感谢!

我会先在 Chrome 中打开 "Developer Tools",然后执行操作。如果您观看 "Network tab",您应该能够弄清楚 Web 浏览器将发送的实际请求是什么:

然后使用此处的信息在 curl 中发送相同的请求:

curl -X POST https://www.dnsleaktest.com/results.html \
    -H "Content-Type:application/x-www-form-urlencoded" -d "standard=Standard Test"

您必须确定请求中的重要内容,然后将该信息包含在 curl 命令中。