所以我有这个用BASH编写的工具,它定期获取更新,我曾经使用CURL显示它的更改日志。像这样:
changelog=$(curl --silent -q http://website.com/changelog.txt)
它正在运行,但现在它返回以下内容:
Changelog:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>406 Not Acceptable</title>
</head><body>
<h1>Not Acceptable</h1>
<p>An appropriate representation of the requested resource /changelog.txt could not be found on this server.</p>
<p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</p>
<hr>
<address>Apache (Unix) Server at website.com Port 80</address>
</body></html>
为什么会出现这种情况?或者如何解决它?
答案 0 :(得分:0)
......或者如何修复它?
您收到html错误406.这与请求中的某些不匹配有关&#34;接受标题&#34;,请参阅此处:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
如果您使用其他参数运行curl,也许可以获得更多详细信息:
curl -D - --head http://website.com/changelog.txt