Get请求
1、使用curl命令:
- curl “http://www.baidu.com”
- curl -v “http://127.0.0.1:80/aaa?version=1&host=aaa.com”
2、使用wget命令:
wget “http://www.baidu.com”
post
1、使用curl命令,通过-d参数,把访问参数放在里面,如果没有参数,则不需要-d,
curl -d “username=user1&password=123” “www.test.com/login”
3、发送格式化json请求
curl -i -k -H “Content-type: application/json” -X POST -d ‘{“version”:“6.6.0”, “from”:“mu”, “product_version”:“1.1.1.0”}’ https://10.10.10.10:80/test