使用curl张贴数据时打印响应内容正文 [英] Printing the response content body when using curl to post data
本文介绍了使用curl张贴数据时打印响应内容正文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在ubuntu上使用以下命令:
I'm using the command below on ubuntu:
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"foo":"bar"}' http://localhost:8888/
以下是收到的回复:
< HTTP/1.1 200 OK
< Content-Length: 3
< Content-Type: text/html; charset=UTF-8
< Server: TornadoServer/2.1
<
* Connection #0 to host localhost left intact
* Closing connection #0
所以我的问题是;
推荐答案
终于可以通过以下命令为我工作了: p>
It finally worked for me with this command:
curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":100}' http://localhost/api/postJsonReader.do
这篇关于使用curl张贴数据时打印响应内容正文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文