On Aug 1, 9:47 pm, Mikhail Kovalev <mikhail_kova.. .@mail.ruwrote:
Suppose I have something like this
$resource = curl_init();
curl_setopt($re source, CURLOPT_FOLLOWL OCATION, TRUE);
curl_setopt($re source, CURLOPT_RETURNT RANSFER, TRUE);
curl_setopt($re source, CURLOPT_URL, '......');
curl_exec($reso urce);
$lastUrl = curl_getinfo($r esource, CURLINFO_EFFECT IVE_URL);
curl_close($res ource);
I'm only interested in the $lastUrl address. Is it possible without
wasting bandwidth on downloading the actual trasfer which is at that
address?
Setting RETURNTRANSFER to FALSE outputs transfer directly
I don't know if this is any help to you, because I don't really
understand what you're trying to do and I've never really had much
exposure to curl before, but HTTP supports a HEAD mode. When a HTTP
request occurs it is usually done with a GET, meaning "Send me this
file". If you send HEAD instead of GET the server interoperates it as
"Send me the headers you would have sent if you had sent me the whole
file as normal, but don't send the actual file". Maybe if you use
HEAD to access the data you want you can avoid the overhead of
fetching the whole file. There are restrictions on HEAD, however, you
can't use POST to send the receiver anything. I don't think you can
use GET variables (The ?foo=bar&baz=qu ux style query strings) either,
but if you can live with these restrictions then it should be helpful
to you.