CURL是用于發(fā)出網(wǎng)絡請求的命令行工具,支持多種協(xié)議。也是測試api的利器。

常用功能有:
查看網(wǎng)頁源碼:curl www.xxx.xxx
保存網(wǎng)頁:curl -o www.xxx.xxx
自動跳轉(zhuǎn):curl -L www.xxx.xxx
顯示頭信息:curl -i www.xxx.xxx
顯示通訊過程: curl -v www.xxx.xxx, 或保存更詳細的通訊過程到輸出文件:curl --trace outout.txt www.xxx.xxx
發(fā)送表單信息:
GET: curl tvbs.cc/form.cgi?data=xxx
POST: curl --data "key=value" tvbs.cc/form.cgi
文件上傳
Referer字段
User Agent字段
Cookie
增加頭信息
Http認證
更多的詳細的命令查看:https://curl.haxx.se/docs/httpscripting.html
在linux中的安裝命令:
lybing@ubuntu:/usr/local/tutorial$ sudo apt-get install curl Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libcurl3 The following NEW packages will be installed: curl The following packages will be upgraded: libcurl3 1 upgraded, 1 newly installed, 0 to remove and 23 not upgraded. Need to get 123 kB/296 kB of archives. After this operation, 314 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main curl amd64 7.35.0-1ubuntu2.7 [123 kB] Fetched 107 kB in 17s (6,013 B/s) (Reading database ... 179037 files and directories currently installed.) Preparing to unpack .../libcurl3_7.35.0-1ubuntu2.7_amd64.deb ... Unpacking libcurl3:amd64 (7.35.0-1ubuntu2.7) over (7.35.0-1ubuntu2.6) ... Selecting previously unselected package curl. Preparing to unpack .../curl_7.35.0-1ubuntu2.7_amd64.deb ... Unpacking curl (7.35.0-1ubuntu2.7) ... Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Setting up libcurl3:amd64 (7.35.0-1ubuntu2.7) ... Setting up curl (7.35.0-1ubuntu2.7) ... Processing triggers for libc-bin (2.19-0ubuntu6.9) ... bing@ubuntu:/usr/local/tutorial$
另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
分享題目:安裝CURL-創(chuàng)新互聯(lián)
網(wǎng)頁路徑:http://chinadenli.net/article46/dpeheg.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供小程序開發(fā)、微信公眾號、做網(wǎng)站、響應式網(wǎng)站、網(wǎng)站維護、自適應網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容