cURL / Mailing Lists / curl-library / Single Mail

curl-library

What differs?

From: Fredrik Gustafsson <iveqy_at_iveqy.com>
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" https://10.1.1.1/cgi-bin/netlogon.cgi

and my c++ program:
#include <curl/curl.h>
#include <iostream>
using namespace std;
int main()
{
    CURL * con;
    CURLcode res;
    string post =
"action=Login&login=user&password=password&org=LU";
    con = curl_easy_init();
    if(con)
    {
        curl_easy_setopt(con, CURLOPT_URL,
"https://10.1.1.1/cgi-bin/netlogon.cgi");
        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);
        curl_easy_cleanup(con);
        cout << "Result: " << res << endl;
    }
    return 0;
}

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