curl-users
POST empty content in chunked encoding
Date: Thu, 19 Apr 2012 15:22:20 +0000
Hello,
I'm posting an empty content using chunked encoding:
$ ./curl-7.25.0/src/curl --trace - -d @empty.txt --header "Transfer-Encoding: chunked" http://172.16.19.0:8080
== Info: About to connect() to 172.16.19.0 port 8080 (#0)
== Info: Trying 172.16.19.0...
== Info: connected
== Info: Connected to 172.16.19.0 (172.16.19.0) port 8080 (#0)
=> Send header, 224 bytes (0xe0)
0000: 50 4f 53 54 20 2f 20 48 54 54 50 2f 31 2e 31 0d POST / HTTP/1.1.
0010: 0a 55 73 65 72 2d 41 67 65 6e 74 3a 20 63 75 72 .User-Agent: cur
0020: 6c 2f 37 2e 32 35 2e 30 20 28 69 36 38 36 2d 70 l/7.25.0 (i686-p
0030: 63 2d 6c 69 6e 75 78 2d 67 6e 75 29 20 6c 69 62 c-linux-gnu) lib
0040: 63 75 72 6c 2f 37 2e 32 35 2e 30 20 4f 70 65 6e curl/7.25.0 Open
0050: 53 53 4c 2f 30 2e 39 2e 38 6b 20 7a 6c 69 62 2f SSL/0.9.8k zlib/
0060: 31 2e 32 2e 33 2e 33 0d 0a 48 6f 73 74 3a 20 31 1.2.3.3..Host: 1
0070: 37 32 2e 31 36 2e 31 39 2e 30 3a 38 30 38 30 0d 72.16.19.0:8080.
0080: 0a 41 63 63 65 70 74 3a 20 2a 2f 2a 0d 0a 54 72 .Accept: */*..Tr
0090: 61 6e 73 66 65 72 2d 45 6e 63 6f 64 69 6e 67 3a ansfer-Encoding:
00a0: 20 63 68 75 6e 6b 65 64 0d 0a 43 6f 6e 74 65 6e chunked..Conten
00b0: 74 2d 54 79 70 65 3a 20 61 70 70 6c 69 63 61 74 t-Type: applicat
00c0: 69 6f 6e 2f 78 2d 77 77 77 2d 66 6f 72 6d 2d 75 ion/x-www-form-u
00d0: 72 6c 65 6e 63 6f 64 65 64 0d 0a 0d 0a 30 0d 0a rlencoded....0..
=> Send data, 7 bytes (0x7)
0000: 0d 0a 30 0d 0a 0d 0a ..0....
== Info: upload completely sent off: 7 out of 0 bytes
empty.txt is an empty file (created with "touch empty.txt").
The server is confused because curl sends 2 empty chunks instead of 1.
Is it the normal behavior or is it a bug ?
Thanks,
Arnaud
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-04-19