我在我的终端,我想向给POST定的URL 发送请求.我已经使用REST客户端对此进行了测试,因此我知道参数有效.
所以我想说要POST以下参数:
到我的网址:https://exmaple.com/login/
我在我的终端尝试了以下curl命令(我正在使用OSX Lion)
curl --data "username=tony&password=secret" http://exmaple.com/login/
Run Code Online (Sandbox Code Playgroud)
我500 Server Error从服务器回来了,所以我现在想的是REST客户端和curl命令之间可能有所不同.
谢谢你的帮助
更新:我正在使用https服务.我是否必须调整我的curl命令来解决这个问题?
rus*_*sau 23
试试这个
curl -F username=tony -F password=secret http://exmaple.com/login/
Run Code Online (Sandbox Code Playgroud)
-F(引用)应该和--data一样吗?可能问题出在webapp上.
也许您正在使用的应用程序使用基本身份验证进行身份验证?试试这个:
curl --user name:password http://exmaple.com/login/
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
57864 次 |
| 最近记录: |