cURL / Mailing Lists / curl-library / Single Mail

curl-library

curl/libcurl http post problem

From: Prasad J Pandit <prasad.pandit_at_comat.com>
Date: Tue, 15 Apr 2008 12:50:02 +0530 (IST)

    Hello guys, greetings to all!

I tried to post the same data(which is > 1500 bytes), as my program, using
curl(1) command, and this is what I receieved:

==
  curl: (18) transfer closed with outstanding read data remaining
==

(18) is what my program also receives, I've said that before. I'm using
the following curl(1) command on FC8

==
curl 7.17.1 (i386-redhat-linux-gnu) libcurl/7.17.1 NSS/3.11.7.1 zlib/1.2.3
libidn/0.6.14
Protocols: tftp ftp telnet dict http file https ftps
Features: IDN IPv6 Largefile SSL libz
==

Though, the libcurl library linked with my windows program is the latest
one. The reply I'm suppose to receice from the server is as below
(Courtesy: Wireshark)

==
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Date: Tue, 15 Apr 2008 06:11:35 GMT
Server: CherryPy/3.0.1

7
  [true]
0
==

   Does libcurl handles `chuncked' reply properly?

Hard to believe/reason that, to get this small `[true/false]' reply I'm
struggling for more than two weeks now, courtesy: `libcurl'(Don't you say:
go use something else).

Second thing, when I used $http_proxy="http://127.0.0.1:3128/", curl(1)
could/did not read the data file. All the following commands would just
not exit and go on forever, and the server did not receive the POST data.

   $ curl -d @/tmp/post-data http://172.16.1.1:5666/test
   $ curl --data @/tmp/post-data http://172.16.1.1:5666/test
   $ curl --data `cat /tmp/post-data` http://172.16.1.1:5666/test

I had to do `$ export -n http_proxy', and only then I got the above (18)
reply.

Strange may it sound, but the folllowing command worked perfectly fine,
and gave me the proper reply of [true], that too without fiddling with the
$http_proxy

  $ wget --post-file=/tmp/post-data http://172.16.1.1:5666/test

Again, don't tell me to go use something else. I want/expect the proper
reason, for all this.

Hope I was clear enough...thank you!

--
Regards
   - Prasad
Received on 2008-04-15