cURL / Mailing Lists / curl-library / Single Mail


To get correct Content Length in headers

From: Ajay Tanpure <>
Date: Sat, 16 Mar 2013 18:04:57 +0530

     I am using libcurl to send http post request to http server.
I get the data from another process, Its size is variable every time.
I add that data in POSTFIELD of the request in curl_easy_setopt() function.

My data contains character '\000' so i get the different content length in
header causing problem on server side.

Ex. data: buf[4];
              buf = "\037\000\000\000"

Now the when i read data from process it gives content length as 4, and in
header i got it as 1.

How to deal with this NULL character?

Changing each character by increasing ASCII value is one way but it is not
efficient as i need to change and again retrieve original
byte for all my data (may be in GBs).


List admin:
Received on 2013-03-16