【发布时间】:2015-04-01 14:25:37
【问题描述】:
我正在用 Flask 编写 API。使用浏览器进行测试效果很好:
http://stuff.com/login?username=test@test.com&password=testpassword
返回我所期望的。
但是,我尝试以两种方式将其输入 curl(请原谅我的无知,LAMP 新手)
卷曲http://stuff.com/login?username=test@test.com&password=testpassword
curl -i http://stuff.com/login?username=test@test.com&password=testpassword
不幸的是,查询中的变量没有发送到服务器,因为我的错误消息类似于传递:
http://stuff.com/login?username=
帮助?
【问题讨论】:
-
我不确定,但这有帮助吗:superuser.com/questions/149329/… ?
-
尝试用单引号括住网址:
curl 'http://stuff.com/login?username=test@test.com&password=testpassword' -
明白了。谢谢。随意回答,我会验证的。