cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

Re: Help with C and curl

From: Dimitar Dimitrov <silent.cutthroat_at_gmail.com>
Date: Sat, 3 Oct 2009 20:51:04 +0300

On Sat, Oct 3, 2009 at 7:56 PM, <pppsss7_at_gmail.com> wrote:
>   char errbuf[CURL_ERROR_SIZE],result;
...
>       curl_easy_getinfo(curl,CURLINFO_CONTENT_TYPE,&result);
>       printf("%c\n", result);

From the manual:
> CURLINFO_CONTENT_TYPE
> Pass a pointer to a char pointer to receive the content-type of the downloaded object.

result should be a pointer, so curl_easy_getinfo can store the address
of the string there:
> char *result;

And then print it with:
> printf("%s\n", result);
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-10-03

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET