[erlang-questions] Problem of post the data with httpc

Solomon solomon.wzs@REDACTED
Tue May 27 12:05:29 CEST 2014


Hi.

When I use curl post the data to mochiweb like this:

curl http://192.168.1.1 -d "hello"

I could call Req:parse_post() to get the data like [{"hello",[]}], and call
Req:recv_body() to get the data like <<"hello">>.

When I use httpc post the data to mochiweb like this:

httpc:request(post, {"http://192.168.1..1", [], [], "hello"}, [], [])

I could call Req:recv_body() to get the data like <<"hello">>, but when I
call Req:parse_post(), it return [].

How should I post data with httpc like curl?

Regards,
Solomon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140527/c7abd30a/attachment.htm>


More information about the erlang-questions mailing list