“GET /wx/button/ningxiahongbtn314.swf HTTP/1.1 \r\n"
 "Accept: */*\r\n"
 "Accept-Encoding: gzip, deflate \r\n"
 "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT         5.0; Assistant 1.0.2.3) \r\n"
 "Host: ad4.sina.com.cn \r\n"
 "Connection: Keep-Alive \r\n"
 "\r\n";
请求头的格式我可以肯定是正确的(我用Effetech截获的)。谁知道为什么啊分数只有这么一点了。如果能够解决可以过两天再加

解决方案 »

  1.   

    服务器的返回代码是 HTTP/1.1 400 Bad Request
    Content-Length: 170<HTML><HEAD>
    <TITLE>400 Bad Request</TITLE>
    </HEAD><BODY>
    <H1>Bad Request</H1>
    Your browser sent a request that this server could not understand.<P>
    </BODY></HTML>
    发送的代码也可以肯定正确
      

  2.   

    “GET /wx/button/ningxiahongbtn314.swf HTTP/1.1 \r\n"
    "Host: ad4.sina.com.cn \r\n"
    "Accept: */*\r\n"
       "Connection: close \r\n"
     "\r\n";
      

  3.   

    “GET http://ad4.sina.com.cn/wx/button/ningxiahongbtn314.swf HTTP/1.1 \r\n"
     "Accept: */*\r\n"
     "Accept-Encoding: gzip, deflate \r\n"
     "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT         5.0; Assistant 1.0.2.3) \r\n"
     "Host: ad4.sina.com.cn \r\n"
     "Connection: Keep-Alive \r\n"
     "\r\n";
    sina用了透明的SQUID代理做负载平衡,需要使用完全路径来访问
      

  4.   

    谢谢!我是在开发代理,对于很多的请求头我都是把他改为相对路径,那么怎么才能确定用完全路径还是相对路径去get
      

  5.   

    注意
    The absoluteURI form is REQUIRED when the request is being made to a proxy. The proxy is requested to forward the request or service it from a valid cache, and return the response. Note that the proxy MAY forward the request on to another proxy or directly to the server specified by the absoluteURI. In order to avoid request loops, a proxy MUST be able to recognize all of its server names, including any aliases, local variations, and the numeric IP address. An example Request-Line would be:        GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1To allow for transition to absoluteURIs in all requests in future versions of HTTP, all HTTP/1.1 servers MUST accept the absoluteURI form in requests, even though HTTP/1.1 clients will only generate them in requests to proxies. 也就是说PROXY server总是应该使用完全路径访问HTTP 1.1的Server