cURL / Mailing Lists / curl-library / Single Mail

curl-library

Additional newline in HTTP Post?

From: Michael Becker <space.monkey_at_web.de>
Date: Mon, 19 Apr 2004 17:46:00 +0200

Hello!

I am new to this list and to curl, and I don't even know if I am asking
the right questions on the right list. So if this is not the right
place, please point me to where I should ask my question. Thank you :-)

Here's my problem:
I need to upload a multipart HTTP form, including an image (jpeg) file
and a key=value string pair. The server application is a pretty
monstrous Java application.
Now when I perform a simple command-line curl command like that
        curl -F file=@image.jpg -F uploadid = theUploadId http://www.myhost.de

everything works as expected.

But in my application (using libcurl on Mac OS X 10.3), it doesn't
work. The only difference in the HTTP data that is sent is one
additional newline in the libcurl HTTP data.
It appears after the "Content-Type: multipart/form-data;
boundary=curlU7t6Okfhv4Roe2bPp8O3N9p2mCg" line.

I am not a HTTP expert at all, but the server admin told me that this
additional newline could confuse the Java application.

So my question:
Could this really be the reason why it's not working correctly? This
additional newline seems to appear only in libcurl calls, whereas
Safari, Internet Explorer, curl etc. all do not have that newline...

Best regards,
Michael
Received on 2004-04-19