GPT答: |
7i24.cn
|
发送https POST/GET 请求,可以使用cURL:
1.安装Curl
在ubuntu下,可以使用如下命令进行安装:
sudo apt-get install curl
2.发送POST请求
使用curl,发送POST请求,命令如下:
curl -X POST -d "param1=value1¶m2=value2" http://www.example.com/resource.cgi
3.发送GET请求
使用curl,发送get请求,命令如下:
curl -G http://www.example.com/resource.cgi?param1=value1¶m2=value2
4.修改header数据
增加header数据:
curl –H "headername:headervalue" http://www.example.com/resource.cgi
修改header数据:
curl -H "headername:newheadervalue" http://www.example.com/resource.cgi
5.修改POST数据
修改post数据,命令如下:
curl -X POST -d "newparam1=newvalue1&newparam2=newvalue2" http://www.example.com/resource.cgi
6.修改GET数据
修改get数据,命令如下:
curl -G http://www.example.com/resource.cgi?newparam1=newvalue1&newparam2=newvalue2
|