按鍵精靈curl 文件 和 使用方法

lua插件放到?按鍵精靈手機(jī)助手 安裝位置的 Plugin?文件夾里面?


使用curl必須保證/system/bin 和?/system/lib 文件夾里有 curl 和libcurl 兩個(gè)文件,有的curl 版本可能不需要libcurl


手機(jī)版按鍵精靈是通過(guò)luaos.execute函數(shù)來(lái)執(zhí)行curl的


調(diào)用方法:


用法和linux的方式是一樣的:

os.execute(curl http://yesp.top)--獲取網(wǎng)頁(yè)源碼

以下是本人測(cè)試在按鍵精靈上可用的curl 用法:

--GET方式提交數(shù)據(jù)

curl?-G?-d?"name=value&name2=value2"?http://www.baidu.com

--POST方式提交數(shù)據(jù)

curl?-d?"name=value&name2=value2"?http://www.baidu.com #post數(shù)據(jù)

--以表單的方式上傳文件

curl?-F?file=@/tmp/me.txt?http://www.aiezu.com

curl -F key=123 -F data=123 -F file=@/sdcard/1.png http://yesp.top

--設(shè)置header

curl?-A?"Mozilla/5.0 Firefox/21.0"?http://www.baidu.com #設(shè)置http請(qǐng)求頭User-Agent

curl?-e?"http://pachong.org/"?http://www.baidu.com #設(shè)置http請(qǐng)求頭Referer

curl?-H?"Connection:keep-alive \nUser-Agent: Mozilla/5.0"?http://yesp.top

--http響應(yīng)頭處理

curl?-I?http://www.aiezu.com #僅僅返回header

curl?-D?/tmp/header?http://www.aiezu.com #將http header保存到/tmp/header文件

--curl認(rèn)證

curl?-u?aiezu:password?http://www.aiezu.com #用戶(hù)名密碼認(rèn)證

curl?-E?mycert.pem?https://www.baidu.com #采用證書(shū)認(rèn)證

--curl_ftp?幾種寫(xiě)法

curl ftp://ip:端口/路徑/ --user name:passwd

curl ftp://ip:端口/路徑/ name:passwd? ? #簡(jiǎn)潔寫(xiě)法

curl ftp://name:passwd@ip:端口/路徑/? ? #簡(jiǎn)潔寫(xiě)法2

--FTP上傳

curl --user user:pass -T /file/name ftp://ip:端口/路徑/

--FTP下載

curl ftp://ip:端口/路徑/ –u name:passwd -o size.zip

curl ftp://ip:端口/路徑/ –u name:passwd -o /保存路徑

--FTP刪除

curl -u name:passwd ftp://ip:端口/ -X 'DELE 路徑'

--列出ftp服務(wù)器上的目錄列表

curl ip:端口/路徑/ –u name:passwd




下載地址見(jiàn)評(píng)論


最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容