在 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/