十年網(wǎng)站開發(fā)經(jīng)驗(yàn) + 多家企業(yè)客戶 + 靠譜的建站團(tuán)隊(duì)
量身定制 + 運(yùn)營維護(hù)+專業(yè)推廣+無憂售后,網(wǎng)站問題一站解決
curl是基于URL語法在命令行方式下工作的文件傳輸工具,它支持FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE及LDAP等協(xié)議。
目前創(chuàng)新互聯(lián)已為超過千家的企業(yè)提供了網(wǎng)站建設(shè)、域名、網(wǎng)絡(luò)空間、網(wǎng)站托管、企業(yè)網(wǎng)站設(shè)計(jì)、留壩網(wǎng)站維護(hù)等服務(wù),公司將堅(jiān)持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長,共同發(fā)展。
curl支持HTTPS認(rèn)證,并且支持HTTP的POST、PUT等方法, FTP上傳, kerberos認(rèn)證,HTTP上傳,代理服務(wù)器, cookies, 用戶名/密碼認(rèn)證, 下載文件斷點(diǎn)續(xù)傳,上載文件斷點(diǎn)續(xù)傳,,http代理服務(wù)器管道( proxy tunneling), 甚至它還支持IPv6, socks5代理服務(wù)器,,通過http代理服務(wù)器上傳文件到FTP服務(wù)器等等,功能十分強(qiáng)大。
# curl的常用選項(xiàng): -A/--user-agent設(shè)置用戶代理發(fā)送給服務(wù)器 -basic 使用HTTP基本認(rèn)證 --tcp-nodelay 使用TCP_NODELAY選項(xiàng) -e/--referer 來源網(wǎng)址 --cacert CA證書 (SSL) --compressed 要求返回是壓縮的格式 -H/--header 自定義頭信息傳遞給服務(wù)器 -I/--head 只顯示響應(yīng)報(bào)文首部信息 --limit-rate 設(shè)置傳輸速度 -u/--user 設(shè)置服務(wù)器的用戶和密碼 -0/--http1.0 使用HTTP 1.0
#使用mod_deflate模塊壓縮頁面優(yōu)化傳輸速度 [root@bogon ~]# curl -I 192.168.1.33:80 HTTP/1.1 403 Forbidden Date: Mon, 10 Jul 2017 00:46:21 GMT Server: Apache/2.2.15 (CentOS) Accept-Ranges: bytes Content-Length: 4954 #文本大?。?954 Connection: close Content-Type: text/html; charset=UTF-8 #text/html格式 #/etc/httpd/conf/httpd.conft添加deflate壓縮模塊 SetOutputFilter DEFLATE # mod_deflate configuration # Restrict compression to these MIME types AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE text/css # Level of compression (Highest 9 - Lowest 1) DeflateCompressionLevel 9 # Netscape 4.x has some problems. BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html [root@bogon ~]# service httpd reload #重啟httpd服務(wù) Reloading httpd: [root@bogon ~]# curl -I --compressed 192.168.1.33:80 HTTP/1.1 403 Forbidden Date: Mon, 10 Jul 2017 00:46:59 GMT Server: Apache/2.2.15 (CentOS) Accept-Ranges: bytes Vary: Accept-Encoding Content-Encoding: gzip #gzip格式 Content-Length: 1991 #文檔大?。?991 Connection: close Content-Type: text/html; charset=UTF-8