gpt4 book ai didi

linux - Netcat HTTP 发布

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:00:59 25 4
gpt4 key购买 nike

在 linux 中使用 netcat 时,我可以从命令行执行 get fine。

nc google.com 80
GET / HTTP/1.1
Host:google.com

有人可以告诉我如何发帖吗?我试过没有运气。我还尝试使用\r\n 或换行的不同组合。我可以让它在 perl 和 c 中工作。

nc google.com 80
POST /test.php HTTP/1.1
Host:whatever.com
Content-Type:text/html
Content-Length:10

text=hello

header 显示它成功但没有返回任何内容?请帮忙

最佳答案

我能够通过使用 wireshark 进行故障排除来使其正常工作。

我需要添加一个内容类型

这行得通


POST/test.php HTTP/1.1
主机:127.0.0.1
内容类型:应用程序/x-www-form-urlencoded
内容长度:9

txt=99999



-----

PHP

关于linux - Netcat HTTP 发布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4929041/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com