curl-library
posting binary data
Date: Mon, 05 Mar 2007 14:52:38 +0100
Hi,
since we upgraded our client to libcurl version 7.16.0 (win32) we
experience problems while posting a request with binary data.
The client posts a request like this:
POST /mmas/wbe_302S/wbe.picture.osp HTTP/1.1
Host: 193.166.131.188:8080
Accept: */*
Content-Type: image/png
Content-Length: 0
But instead of waiting for a response from the server, the client starts
immediately sending the binary data!
The client receives a 401 response from the server, but does not retry
the HTTP request with authentication (probably because the binary data
is already being sent).
The following curl options are set:
curl_easy_setopt ( pCURL, CURLOPT_PRIVATE, (void *)pUpload );
curl_easy_setopt ( pCURL, CURLOPT_URL, remotePathName.c_str () );
curl_easy_setopt ( pCURL, CURLOPT_POST, 1 ); curl_easy_setopt (
pCURL, CURLOPT_READDATA, pFile ); curl_easy_setopt ( pCURL,
CURLOPT_POSTFIELDSIZE, fileSize );
curl_easy_setopt ( pCURL, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST );
curl_easy_setopt ( pCURL, CURLOPT_USERPWD, login.c_str () );
curl_easy_setopt ( pCURL, CURLOPT_CAPATH, certificateDirectory );
pCURLList = curl_slist_append ( pCURLList, "Content-Type: image/png" );
curl_easy_setopt ( pCURL, CURLOPT_HTTPHEADER, pCURLList );
kind regards,
Sigrid
Received on 2007-03-05