cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problem with curl_easy_getinfo

From: Ralph Mitchell <rmitchell_at_eds.com>
Date: Sat, 26 Jun 2004 00:23:23 -0500

You might want to take a look at:

    docs/examples/getinmemory.c

in the curl source distribution. It demonstrates how to get a webpage
into a block of memory.

Ralph Mitchell

Marek Elsner wrote:

>Ok thanks.
>I have got one more question.
>Cause I am really beginner, could you tell me how to write simple program
>which will store a content of webpage into char[] variable.
>thanks a lot
>
>M
>
>----- Original Message -----
>From: "codemastr" <codemstr_at_ptd.net>
>To: "libcurl development" <curl-library_at_cool.haxx.se>
>Sent: Friday, June 25, 2004 7:15 PM
>Subject: Re: Problem with curl_easy_getinfo
>
>
>
>
>>The response code is the HTTP response code. For example, 404 when a page
>>
>>
>is
>
>
>>not found, 500 when the server has an error, 401 when authentication
>>
>>
>fails,
>
>
>>etc. It is not the contents of the page. If you want to retrieve the
>>contents of the page, then you need to look at the CURLOPT_WRITEFUNCTION
>>setting.
>>
>>-- codemastr
>>
>>
>>----- Original Message -----
>>From: "Marek Elsner" <marek_at_icom.pl>
>>To: <curl-library_at_cool.haxx.se>
>>Sent: Friday, June 25, 2004 1:05 PM
>>Subject: Problem with curl_easy_getinfo
>>
>>
>>Hello,
>>
>>I am newbie, so probably my problem will sound funny.
>>;-)
>>
>>If I want to write last URL into variable "m" I am using
>>curl_easy_getinfo(curl,CURLINFO_EFFECTIVE_URL,&m); and everything is ok.
>>
>>Now I would like to write whole content of the webpage into "m" variable.
>>So I think I should use CURLINFO_RESPONSE_CODE, but when I am trying to
>>
>>
>do:
>
>
>>(curl,CURLINFO_RESPONSE_CODE,&m); it does not work.
>>
>>On http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html I read that
>>CURLINFO_RESPONSE_CODE will pass a pointer to a long.
>>But content of the page will not be long ( I suppose long means long int).
>>
>>Maybe someone will show me where I made it wrong because now I am totally
>>lost.
>>:-D
>>
>>thank
>>
>>Marek Elsner
>>
>>
>>
>>
>>
>>
>
>
>
>
>
Received on 2004-06-26