Linux系统发送Http请求
- post请求无参
curl --location --request POST 'http://localhost:8080/testController/testtest'
- post请求并传递json串
curl -H "Content-type: application/json" -X POST -d '{"page":1,"perpage":20}' http://localhost:8080/test
- get请求
curl --location --request GET 'http://localhost:8080/testController/testtest'
这篇博客介绍了如何在Linux环境中使用curl命令行工具发送Http请求。包括无参数的POST请求,传递JSON数据的POST请求以及GET请求的实例。通过这些例子,读者可以学会在Linux shell中与Web服务进行交互的基本技巧。

1107

被折叠的 条评论
为什么被折叠?



