curl-library
Re: Additional newline in HTTP Post?
Date: Mon, 19 Apr 2004 23:09:01 +0200 (CEST)
On Mon, 19 Apr 2004, Michael Becker wrote:
> 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 :-)
You've reached the perfect place for this!
> 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.
This boundary string shows us that you're using a slightly older libcurl
version. Since I don't know how old, I can't tell you if we've fixed any bugs
since.
However, I don't think this particular issue has been a problem in the past
nor in the current version. When doing a multipart formpost, that line is the
last one amont the HTTP headers. It is then bound to end with a trailing CRLF
and you'll see an extra set of CRLF afterwards to separate the headers from
the request-body.
The request-body will then start with a boundary separator string.
> I am not a HTTP expert at all, but the server admin told me that this
> additional newline could confuse the Java application.
Sorry, I can't see any "additional newline"! Can you show us a trace or
something of the POST?
> 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...
I don't think so, but I can guarantee it!
-- Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se Dedicated custom curl help for hire: http://haxx.se/curl.htmlReceived on 2004-04-19