Reputation: 3046
I'm writing a script that will use cURL to check a number of links. I know I can use curl_getinfo()
to get the http status code, but I'm not sure if that requests the entire page or just the response with the headers. Is there any curl option or setting I can use to only request the headers of the URL (i.e. 404 not found, moved, etc) ?
Upvotes: 0
Views: 87
Reputation: 35235
You can instruct cURL to not download the contents (body) of the request by setting the CURLOPT_NOBODY
option to TRUE
- see
Does CURLOPT_NOBODY still download the body - using bandwidth
p.s. curl_getinfo()
does not make requests - it gets information from requests that have already been executed.
Upvotes: 1