curl-library
Re: libcurl: Windows vs Mac
Date: Thu, 12 Jul 2012 01:06:02 +0200
Hi Igor,
Am 11.07.2012 21:38, schrieb Igor Korot:
> I am new to libcurl and trying to write cross-platform software having problem.
>
> Here is my code:
>
> CURLcode error;
> char errorMsg[1024];
> wxString boundary = wxString::Format( "---------------------------%x",
> static_cast<unsigned int>( time( NULL ) ) );
> curl_easy_setopt( handle, CURLOPT_URL,
> "http://174.122.236.154/TouchAndRead/Default.aspx" );
> curl_easy_setopt( handle, CURLOPT_POSTFIELDS, const_cast<char *>(
> boundary.ToAscii().data() ) );
> curl_easy_setopt( handle, CURLOPT_ERRORBUFFER, errorMsg );
> error = curl_easy_perform( handle );
>
> Running on Mac/Cocoa this executes fine. When ran on Windows however,
> I am getting CURLE_WRITE_ERROR
> and the errorMsg contains: "Failed writing body(1416 != 1460)".
>
> Is there some option I'm missing to set for Windows? AFAIU,
> CURLOPT_INFILESIZE_LARGE is for files only...
if that is all of your code I dont see curl_easy_init() nor
curl_easy_cleanup() ...
see here for a http post sample in C:
http://curl.haxx.se/libcurl/c/http-post.html
also you might have to call
curl_global_init(CURL_GLOBAL_WIN32);
see:
http://curl.haxx.se/libcurl/c/curl_global_init.html
Gün.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-07-12