cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Why at use CURLOPT_NOBODY remote server fulfils request Incorrectly?

From: SID <webdriver_at_gmail.com>
Date: Sun, 20 Mar 2005 06:58:55 +0300

Hi all,

I do not know as most precisely put into words the question. Approximately so:
Why at use CURLOPT_NOBODY remote server fulfils request Incorrectly?

---------
Example 1:
        $ch = curl_init();
        curl_setopt ($ch, CURLOPT_URL,
"http://blog.my-choice.biz/index.php?disp=stats");
        curl_setopt ($ch, CURLOPT_REFERER, "http://blablabla-one.com");
        curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt ($ch, CURLOPT_HEADER, 1);
        curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "GET");
        $str = curl_exec ($ch);
        curl_close ($ch);

Header of the remote server:
HTTP/1.1 200 OK Date: Sun, 20 Mar 2005 03:16:31 GMT Server:
Apache/1.3.33 (Unix) (Red-Hat/Linux) mod_layout/3.2 Connection: close
Transfer-Encoding: chunked Content-Type: text/html
----------
Example 2:
        ...
        curl_setopt ($ch, CURLOPT_REFERER, "http://blablabla-two.com");
        curl_setopt ($ch, CURLOPT_NOBODY, 1);
        ...

Header of the remote server:
HTTP/1.1 200 OK Date: Sun, 20 Mar 2005 03:16:31 GMT Server:
Apache/1.3.33 (Unix) (Red-Hat/Linux) mod_layout/3.2 Connection: close
Transfer-Encoding: chunked Content-Type: text/html
-------------

Conclusion:
Header 1 == Header 2
However Result 1 != Result 2

On page http://blog.my-choice.biz/index.php?disp=stats in the first
variant is present referer http://blablabla-one.com
In the second variant referer http://blablabla-two.com is NOT present

What to make so as variant two(CURLOPT_NOBODY true) worked as in the
first variant(CURLOPT_NOBODY false)?

Configuration:
Libcurl/7.12.2

P.S. I am new to english language and beg your patience.

Sincerely,
Klaus
Received on 2005-03-20