2011-10-21 77 views
1

我試圖訪問Google Search Appliance API:http://code.google.com/apis/searchappliance/documentation/612/gdata/acapi_protocol.html如何使用curl發送HTTP POST?

爲了發送請求,我使用了curl。我的問題是,當我嘗試登錄,使用

curl -k -X POST https://ip.ad.dr.ess:8443/accounts/ClientLogin&Email=username&Passwd=password 

我得到如下:

'Email' is not recognized as an internal or external command, 
operable program or batch file. 
Passwd: unknown user =password 

這個問題的任何幫助,將不勝感激。我是新來捲曲,所以我意識到我可能使用它錯了。

我已經通過捲曲cygwin的安裝在Windows 7

回答

1

嘗試用"封閉你的URL。由於您使用的是&以及其他特殊的bash字符,因此您需要將它們括在引號中。

這是一個bash的問題:

$ curl -k -X POST "https://ip.ad.dr.ess:8443/accounts/ClientLogin&Email=username&Passwd=password" 
0

外殼解釋&字符作爲命令的結束:你需要加上引號整個URL

curl -k -X POST "https://ip.ad.dr.ess:8443/accounts/ClientLogin&Email=username&"