curl#
Curl 用於命令列或腳本中傳輸資料。Curl 也是 libcurl,廣泛應用於汽車、電視機、路由器、印表機、音響設備、行動電話、平板電腦、醫療器材、機上盒、電腦遊戲、媒體播放器,並且是超過二百億個安裝軟體應用的網際網路傳輸引擎。
Install#
$ sudo apt install curlOperate#
curl [options] [URL...]| operation | description |
|---|---|
| -X/–request | 指定 HTTP 請求方法,如 GET、POST、PUT、DELETE |
| -H/–header | 設定 HTTP 請求標頭(如 User-Agent, Content-Type) |
| -d/–data | 傳送資料至伺服器,通常用於 POST 或 PUT 請求 |
| -I/–head | 只取得 HTTP 標頭資訊 |
| -o/–output | 將回應內容寫入指定檔案,而非標準輸出 |
| -L/–location | 自動追蹤 HTTP 重定向 |
| -u/–user | 提供使用者名稱和密碼進行基本認證 |
| -v/–verbose | 顯示詳細的請求和回應過程 |
| –compressed | 啟用壓縮傳輸,減少資料大小 |
| -F/–form | 模擬表單提交,支援檔案上傳 |
Reference#
Official docs: