如何从curl命令获取数据?

时间:2014-09-05 06:05:01

标签: curl

假设我有以下要求:

curl -X POST -H "Content-Type: text/plain" -d 'Hello, World!' http://localhost:3000/1/files/test.txt

在以键/值形式发送数据的情况下(即-d'test:123'),我可以使用params [:test]获得test的值。顺便说一下,我的API需要这个。但是,只有 params ,正如我一开始所猜测的那样,我无法得到“Hello,World!”字符串,用于进一步处理。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

答案是 request.body.read 。 (在Ruby中)

相关问题