cURL / Mailing Lists / curl-library / Single Mail


simple HTTP POST help needed

From: ChristinaPSU <>
Date: Thu, 22 Jan 2009 09:48:25 -0500


I made a small program to POST a message to a HTTP Server. What I am wondering, is how do I get the acknowledgement message form the HTTP server with libcurl? I think I probably need to use a callback, but I read the docs and I am confused. Can anyone help me here? Here is the code to my program so far:

#include <CurlHandle.h>
using namespace std;

CCurlHandle::CCurlHandle(string url)
    _easyHandle = curl_easy_init();
    #ifdef DEBUG
    curl_easy_setopt(_easyHandle, CURLOPT_VERBOSE, 1);
    curl_easy_setopt(_easyHandle, CURLOPT_HEADER, 1);
    _url = url;
    int errorCode = curl_easy_setopt(_easyHandle, CURLOPT_URL, _url.c_str());


void CCurlHandle::SendDatatoHTTPServer(string data)
    // send data to _url
    curl_easy_setopt(_easyHandle, CURLOPT_POSTFIELDS, data.c_str());
    curl_easy_setopt(_easyHandle, CURLOPT_URL, _url);
Received on 2009-01-22