原創:轉載需注明原創地址 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