Linux curl命令進行網絡請求


原創:轉載需注明原創地址 https://www.cnblogs.com/fanerwei222/p/11841353.html

 

1. curl get請求:

curl http://www.baidu.com

2. curl post請求: -H表示請求頭, -X表示代理, --data表示請求體的JSON數據

curl -H "Content-Type:application/json" -H "other : hello" -X POST --data "{\"hello\":\"world\",\"yes\":\"no\"}" http://127.0.0.1:8080/test/api/hello

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM