【问题标题】:Download chunked resource with wget?使用 wget 下载分块资源?
【发布时间】:2011-04-05 20:32:30
【问题描述】:

有一个带有此控制器的示例 ASP.NET 项目:

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
   protected void Page_Load(object sender, EventArgs e)
   {
       Response.Write("test1234");
       Response.Clear();
       Response.Flush();
       Response.Write("test5");
       Response.End();
   }
}

在浏览器(Chrome 10)中,我看到“test5”和 传输编码:分块

当尝试使用 wget(从最新的 Cygwin)下载时,我得到了

$ wget -S  --read-timeout=60 http://127.0.0.1/EmptyWebSite/test/
--2011-04-05 23:25:51--  http://127.0.0.1/EmptyWebSite/test/
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Server: Microsoft-IIS/5.1
  Date: Tue, 05 Apr 2011 20:25:51 GMT
  X-Powered-By: ASP.NET
  X-AspNet-Version: 2.0.50727
  Cache-Control: private
  Content-Type: text/html
Length: unspecified [text/html]
Saving to: `index.html'

[ <=>  ] 0           --.-K/s   in 0s

而且文件(显然)是空的

怎么了?我可以用 wget / curl 下载这样的资源吗?

【问题讨论】:

    标签: asp.net curl wget chunked-encoding


    【解决方案1】:

    Wget 从 1.13 版本开始支持 HTTP/1.1 和分块传输

    【讨论】:

      【解决方案2】:

      不适用于 WGET。来自bugs.debian.org

      Wget 对分块传输编码的支持为零(因此,对于 HTTP/1.1)。它只会发送 HTTP/1.0 请求,这意味着 HTTP/1.1 响应是非法的(分块编码也是如此)。

      Curl 支持 HTTP/1.1

      【讨论】:

        【解决方案3】:

        啊,解决了 curl -v 网址...

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2014-02-14
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多