Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
“正确书写”;标题「;及;获得;winsock c+中的请求+; 实际上,我是用Winsock C++下载HTTP文件的代码,并获得了我发射的“头”标题的详细信息。_C++_Winsock_Head - Fatal编程技术网

“正确书写”;标题「;及;获得;winsock c+中的请求+; 实际上,我是用Winsock C++下载HTTP文件的代码,并获得了我发射的“头”标题的详细信息。

“正确书写”;标题「;及;获得;winsock c+中的请求+; 实际上,我是用Winsock C++下载HTTP文件的代码,并获得了我发射的“头”标题的详细信息。,c++,winsock,head,C++,Winsock,Head,(事实上我就是这样做的) HEAD/files/ODBC%20编程%20in%20C%2B%2B.pdf HTTP/1.0 主持人:devmentor-unittest.googlecode.com 答复是: HTTP/1.0 404 Not Found Content-Type: text/html; charset=UTF-8 Set-Cookie: PREF=ID=feeed8106df5e5f1:TM=1370157208:LM=1370157208:S=10bN4nrXqkcCDN5n

(事实上我就是这样做的)

HEAD/files/ODBC%20编程%20in%20C%2B%2B.pdf HTTP/1.0 主持人:devmentor-unittest.googlecode.com 答复是:

HTTP/1.0 404 Not Found Content-Type: text/html; charset=UTF-8 Set-Cookie: PREF=ID=feeed8106df5e5f1:TM=1370157208:LM=1370157208:S=10bN4nrXqkcCDN5n; expires=Tue, 02-Jun-2015 07:13:28 GMT; path=/; domain=devmentor-unittest.googlecode.com X-Content-Type-Options: nosniff Date: Sun, 02 Jun 2013 07:13:28 GMT Server: codesite_downloads Content-Length: 974 X-XSS-Protection: 1; mode=block X-Frame-Options: SAMEORIGIN 未找到HTTP/1.0 404 内容类型:text/html;字符集=UTF-8 设置Cookie:PREF=ID=feeed8106df5e5f1:TM=1370157208:LM=1370157208:S=10bN4nrXqkcCDN5n;expires=周二,2015年6月2日07:13:28 GMT;路径=/;domain=devmentor-unittest.googlecode.com X-Content-Type-Options:nosniff 日期:2013年6月2日星期日07:13:28 GMT 服务器:代码站点下载 内容长度:974 X-XSS-Protection:1;模式=块 X-Frame-Options:SAMEORIGIN 但如果我这样做:

GET /files/ODBC%20Programming%20in%20C%2B%2B.pdf HTTP/1.0 Host: devmentor-unittest.googlecode.com GET/files/ODBC%20编程%20in%20C%2B%2B.pdf HTTP/1.0 主持人:devmentor-unittest.googlecode.com 文件已成功下载

之后,我下载后,如果我再次发射头请求。。。它还提出了以下问题

HTTP/1.0 200 OK Content-Length: 320381 Content-Type: application/pdf Content-Disposition: attachment; filename="ODBC Programming in C++.pdf" Accept-Ranges: bytes Date: Sun, 02 Jun 2013 05:47:11 GMT Last-Modified: Sun, 11 Nov 2007 03:17:59 GMT Expires: Sun, 09 Jun 2013 05:47:11 GMT Cache-Control: public, max-age=604800 Server: DFE/largefile //something like this..... HTTP/1.0 200正常 内容长度:320381 内容类型:application/pdf 内容处置:附件;文件名=“C++中的ODBC编程.pdf” 接受范围:字节 日期:2013年6月2日星期日05:47:11 GMT 最后修改:Sun,2007年11月11日03:17:59 GMT 过期时间:2013年6月9日星期日05:47:11 GMT 缓存控制:公共,最大年龄=604800 服务器:DFE/largefile //像这样的。。。。。 问:为什么“HEAD”一开始会返回错误的“error not found”,但文件是使用“GET”下载的,下载后“HEAD”也会返回我需要的物品……我哪里搞错了


我试图在这里下载的文件是“”(仅举个例子)

问题不在您这边。谷歌代码根本无法正确实现HEAD。这是5年前报告的,现在仍然是一个悬而未决的问题:

HTTP/1.0 200 OK Content-Length: 320381 Content-Type: application/pdf Content-Disposition: attachment; filename="ODBC Programming in C++.pdf" Accept-Ranges: bytes Date: Sun, 02 Jun 2013 05:47:11 GMT Last-Modified: Sun, 11 Nov 2007 03:17:59 GMT Expires: Sun, 09 Jun 2013 05:47:11 GMT Cache-Control: public, max-age=604800 Server: DFE/largefile //something like this.....