Note that there are some explanatory texts on larger screens.

plurals
  1. POwriting proper "HEAD" and "GET" request in winsock c++
    text
    copied!<p>Actually I was coding for downloading the files in HTTP using winsock c++ and to get the details I fired "HEAD" header..</p> <p>(this is what actually I did)</p> <pre> HEAD /files/ODBC%20Programming%20in%20C%2B%2B.pdf HTTP/1.0 Host: devmentor-unittest.googlecode.com </pre> <p>Response was:</p> <pre> 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 </pre> <p>But if I do:</p> <pre> GET /files/ODBC%20Programming%20in%20C%2B%2B.pdf HTTP/1.0 Host: devmentor-unittest.googlecode.com </pre> <p>The file sucessfully gets downloaded....</p> <p>After then after I download, again if I fire the HEAD request... it also brings up the following</p> <pre> 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..... </pre> <p>Question: why "HEAD" is returning the false "error not found" at first but the file gets downloaded in using "GET" and after downloading "HEAD" also returns goodies i need...where have i mistaken..</p> <p>The file I am trying to download here is "<a href="http://devmentor-unittest.googlecode.com/files/ODBC%20Programming%20in%20C%2B%2B.pdf" rel="nofollow">http://devmentor-unittest.googlecode.com/files/ODBC%20Programming%20in%20C%2B%2B.pdf</a>" (just for example)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload