【发布时间】:2015-08-05 10:38:46
【问题描述】:
使用 curl 的简单 GET 请求返回空正文(内容长度:0):
curl -v https://www.flyorientthai.com/booking/en/index.php
另一方面,wget 可以很好地处理该网址:
wget https://www.flyorientthai.com/booking/en/index.php
卷曲有什么问题?
【问题讨论】:
-
也许服务器需要某些 HTTP 标头,curl 通常不会发送但 wget 会发送
-
@MJafarMash 你是绝对正确的 :) curl 请求缺少“Connection: Keep-Alive”标头,结果证明它很关键。
-
这是什么破服务器。 Keep-Alive 在 HTTP/1.1 中是隐含的,所以这个标头是多余的。但是是的,使用
curl -v -H "Connection: keep-alive"会给出预期的响应,而没有标头则不会。
标签: linux ssl curl wget libcurl