cURL / Mailing Lists / curl-library / Single Mail


What differs?

From: Fredrik Gustafsson <>
Date: Wed, 21 Feb 2007 15:46:10 +0100

Hi, I've got a c++ program, that should do the same task as a command
line. The thing is, it doesn't and I can't find out what differs the to.

The command line:
curl -k -d "login=username&password=password=LU&action=Login"

and my c++ program:
#include <curl/curl.h>
#include <iostream>
using namespace std;
int main()
    CURL * con;
    CURLcode res;
    string post =
    con = curl_easy_init();
        curl_easy_setopt(con, CURLOPT_URL,
        curl_easy_setopt(con, CURLOPT_SSL_VERIFYHOST, 0);
        curl_easy_setopt(con, CURLOPT_SSL_VERIFYPEER, 0);
        curl_easy_setopt(con, CURLOPT_POST, post.c_str());
        res = curl_easy_perform(con);
        cout << "Result: " << res << endl;
    return 0;

all help would be really nice!
Received on 2007-02-21