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
是可以显示内容的。
...连接成功。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
是可以显示内容的。
strSend = strSend + " HTTP/1.0\r\n";
host呢 ?
抓包看下包结构
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