http:request doesn't compute content-length of iolist correctly

Paul Mineiro paul-trapexit@REDACTED
Sun Aug 23 22:25:32 CEST 2009


Example:

---------
Shell One:

% nc -l -p 9999
PUT / HTTP/1.1
content-type: text/plain
content-length: 1
te:
host: 127.0.0.1
connection: keep-alive

iodata

---------
Shell Two:
% erl
Erlang (BEAM) emulator version 5.6.5 [source] [smp:2] [async-threads:0] [kernel-poll:false]

Eshell V5.6.5  (abort with ^G)
1> application:start (inets).
ok
2> http:request (put, { "http://127.0.0.1:9999/", [], "text/plain", [ <<"iodata">> ] }, [], []).
--------

It does the right thing if a string is passed as the body, and technically
this is what the documentation says is the proper type for that argument
... but it's a drag because forcing me to flatten an iolist is not the
Erlang way.

-- p


More information about the erlang-bugs mailing list