P4735 最大異或和(可持久化trie樹模板)
阿新 • • 發佈:2020-10-31
curl 介紹:
curl是基於URL語法在命令列方式下工作的檔案傳輸工具,它支援FTP,FTPS,HTTP,HTTPS,GOPHER,TELNET,DICT,FILE及LDAP等協議。curl支援HTTPS認證,並且支援HTTP的POST,PUT等方法,FTP上傳,kerberos認證,HTTP上傳,代理伺服器,cookies,使用者名稱/密碼認證,通過http代理伺服器上傳檔案到FTP伺服器等等,功能十分強大
curl 常用引數:
-I 只顯示請求頭資訊 -d HTTP POST方式傳送資料,以json格式 -o 把輸出寫到該檔案中 -s 靜默模式。不輸出任何東西 -X 指定什麼命令,如GET POST-v 檢視詳情 -u 設定伺服器的使用者和密碼 -H 要傳送到服務端的自定義請求頭 -w 完成後輸出什麼 -b 從檔案中讀取cookie資訊 -F 上傳檔案 -# 顯示進度條
demo:
No 1:curl 命令傳送get請求 示例:curl -X GET http://www.xxx.com/search?data=123 No 2:curl 命令傳送get請求後統計各階段耗時 curl -o /dev/null -s -w "time_namelookup:%{time_namelookup}\ntime_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n" www.xxx.com No 3:curl 命令傳送post請求 curl www.xxx.com/api/openservice/query/queryProperty -H "Content-Type:application/json" -X POST -d '{"baseCondition": {"propertyId": 1, "dateRange": {"fromDate": "2019-07-04", "toDate": "2019-07-05"}, "adults": 1,"children": 0, "rooms": 1, "channelId": 2, "sellCategories": ["PUBLIC", "NEGOTIATE"]},"extensionCondition": {"rateIds": [], "unableFlag":"False", "currency": "CNY"}, "context": {}}' No 4:curl 命令傳送post請求後統計各階段耗時 curl -o /dev/null -s -w "time_namelookup:%{time_namelookup}\ntime_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n" www.xxx.com/api/openservice/query/queryProperty -H "Content-Type:application/json" -X POST -d '{"baseCondition": {"propertyId": 1, "dateRange": {"fromDate": "2019-07-04", "toDate": "2019-07-05"}, "adults": 1,"children": 0, "rooms": 1, "channelId": 2, "sellCategories": ["PUBLIC", "NEGOTIATE"]},"extensionCondition": {"rateIds": [], "unableFlag":"False", "currency": "CNY"}, "context": {}}' No 5:curl 命令儲存檔案到本地 curl -o file.html http://www.xxx.com/index.html No 6:curl 命令登入服務 curl -u name:passwd http://www.xxx.com No 7:curl 命令構造一個請求頭 curl -H "Content-Type:application/json" http://www.xxx.com No 8:curl 命令從檔案中讀取cookie 資訊 curl -b "cookie.txt" http://www.xxx.com No 9:curl 命令上傳檔案 curl -b "cookie.txt" -F "file=@/temp/a.txt" http://www.xxx.com/api/upload -v No 10:curl 命令下載檔案並顯示下載進度 curl -# -o abc.jpg http://www.xxx.com/abc.JPG No 11:curl 命令清除es 裡面的資料 curl -XDELETE http://10.8.102.102:9200/entity-beta-ars6_ars-reservation -uadmin:admin #清理ES
摘自:微信公眾號:無量測試之道