Why is curl truncating this query string?

不想你离开。 提交于 2019-11-27 12:15:59
Bob Kimble

The answer to the question, "what am I doing wrong," is that the shell sees the ampersand (&) and thinks that's the end of the command (and puts it into the background). You need to quote it, which is why the answers that quoted the string work. You could just as easily run this:

curl -v -L "http://localhost:5000/pulse/?lat=41.225&lon=-73.1"
Nishant

I think you can try this:

 curl -v -L -d "lat=41.225&lon=-73.1" http://localhost:5000/pulse

by default, this calls POST. If you want to send a GET request

 curl -v -L -G -d "lat=41.225&lon=-73.1" http://localhost:5000/pulse

More...
and since you're using localhost, if you were to use https, you'd probably want to include -k as an option to ignore certificate errors

Thanks to Ross for pointing this.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!