SOCKET pTcpclient;
...连接成功。CString strSend = "GET /Player/PlayerList.aspx?timeStamp="+sTime;
strSend = strSend + " HTTP/1.0\n\n\n";
string str_send = strSend;Send(pTcpclient,str_send.c_str(),str_send.length(),0);char recvstr[10000];
recv(pTcpclient,recvStr,10000,0);
接受到的数据:
HTTP/1.1 400 Bad Request
Content-Type: text/html
Date: Tue, 01 Sep 2009 02:14:34 GMT
Connection: close
Content-Length: 39<h1>Bad Request (Invalid Hostname)</h1>可我在IE中输入 http://www.runup.com/Player/PlayerList.aspx?timeStamp=4613467945
是可以显示内容的。

解决方案 »

  1.   

    CString strSend = "GET /Player/PlayerList.aspx?timeStamp="+sTime;
    strSend = strSend + " HTTP/1.0\r\n"; 
    host呢 ?
      

  2.   

    抓包  自己组成那种包   才是模拟HTTP的王道
      

  3.   

    Bad Request
    抓包看下包结构
      

  4.   

    Get请求写详细些,看看。对于HTTP协议,向服务器请求某个文件时,只要发送类似如下的请求即可: GET /Path/FileName HTTP/1.0\r\n
    Host: www.server.com:80\r\n 
    Accept: */*\r\n 
    User-Agent: GeneralDownloadApplication\r\n 
    Connection: close\r\n\r\n 参考 
    http://blog.csdn.net/goodname008/archive/2006/01/02/568668.aspx