我使用curl執行獲取操作。 (此鏈接將發出服務器重啓)捲曲不執行動作
curl -v -u username:password http://example.com/index.html?process=waterServer&action=restart
似乎curl忽略了請求中的操作部分。我得到的輸出,
* Trying example.com... connected
* Server auth using Basic with user 'username'
> GET /index.html?process=waterServer HTTP/1.1
> Authorization: BasiC#############
> User-Agent: bla bla bla
> Host: example.com
> Accept: */*
然後輸出HTML頁面,並用線
[1] +完成捲曲-v -u用戶名結束:密碼http://example.com/index.html?process=waterServer
它是正確的行爲?如果上面的鏈接複製粘貼到瀏覽器上,它會詢問用戶名/密碼並重新啓動服務器。
它沒有工作。我得到相同的輸出'> GET /index.html?process=waterServer^ HTTP/1.1> .'最後一行相同'[1] +完成curl -v -L -u用戶名:密碼http://example.com/ index.html?process = waterServer ^' – Netro
好吧,轉義取決於您使用的操作系統。 –
它的Ubuntu的1104 – Netro