cURL / Mailing Lists / curl-library / Single Mail

curl-library

Retrieving POST Data

From: Chris Morbitzer <gamephreak_at_gmail.com>
Date: Wed, 1 Dec 2004 20:44:02 -0500

How do I retrieve POST data from a site in C++? This is what I have so far:

CURL *curl;
CURLcode res;
curl = curl_easy_init();
char *data;
sprintf(data, "map=%d%d", mapidx, mapidy);
res = curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_setopt(curl, CURLOPT_URL, "file.php");
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);

When you post manually to this PHP file, it echoes back the results to
the browser. How do I get this text and store it in a string or
integer?
Received on 2004-12-02