In C++, I want to use libcurl to check that a URL is text/html, and if yes, to then download the body, else it stops.
I want this todo in one step, not first sending HEAD, if HEAD is ok, requesting the page again to download.
If this is not possible with libcurl, does it give other libaries for C++, which would support this?
To send a HTTP HEAD request, you need to set this option up:
and you can also have a look at this question: help needed on libcurl programming in sending HTTP HEAD Request
to separate headers from body (don’t know if it is really needed), you can have a look at :
http://curl.haxx.se/libcurl/c/sepheaders.html
to download lot of different URLs libcurl-multi, you should have a look at :
http://curl.haxx.se/libcurl/c/libcurl-multi.html
slight modification of http://curl.haxx.se/libcurl/c/sendrecv.html: