cURL / Mailing Lists / curl-library / Single Mail

curl-library

simple curl example :))

From: arka kapi <arkakapi_at_gmail.com>
Date: Sun, 25 Sep 2005 21:10:02 +0300

Heloo Everybody

this code is exactly simple but not for me. Line 22. it is terrible.
is there any simple way to get response string. for example ,i want to put
response string to char array. could you write some pice of code. i know
nothing about callback. my c programming language skill is essential. but i
must to use it(curl). or say What are the requirements to use curl library.
Thanks..

11 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L11>
#include <stdio.h>
 12 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L12>
#include <curl/curl.h>
 13 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L13>
 14 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L14> int main(void)
 15 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L15> {
 16 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L16> CURL *curl;
 17 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L17> CURLcode res;
 18 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L18>
 19 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L19> curl
= curl_easy_init();
 20 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L20> if(curl) {
 21 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L21>
curl_easy_setopt(curl, CURLOPT_URL, *"curl.haxx.se
<http://curl.haxx.se>"*);
 22 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L22>
????? res = curl_easy_perform(curl); ????
 23 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L23>
 24 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L24>
*/* always cleanup */*
 25 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L25>
curl_easy_cleanup(curl);
 26 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L26> }
 27 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L27> return 0;
 28 <http://curl.haxx.se/lxr/source/docs/examples/simple.c#L28> }
Received on 2005-09-25