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
原文地址:https://www.cnblogs.com/fanerwei222/p/11841353.html