cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: (null) output from WriteMemoryCallback function

From: Mark Warburton <curl_at_instruform.com>
Date: Wed, 19 May 2004 21:00:17 +1200

>Welcome to reality! ;-)
>I suggest you start with making your request similar to the
>curl command line tool's. I guess this server responds
>differently based on differences in the requests. Lack of
>user-agent might for example be what triggers this.

Excellent suggestion, Daniel. Thank you. Now the command line version of
perl and the getinmemory.c example provide exactly the same output (namely a
web page). To achieve this, I inserted:
curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;
MSIE 5.01; Windows NT 5.0)\0");

into the main function with the other curl_easy_setopts.

It works a treat! Wonderful! Thanks again.
Do you think that putting in a comment into the distributed getinmemory.c file
suggesting a useragent if command line curl and libcurl give different results
is overkill?

Regards
Mark

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
Received on 2004-05-19