crul
- 发送get请求:
curl [https://registry.docker-cn.com](https://registry.docker-cn.com") ;
- 发送post请求:
<font style="color:rgb(51, 51, 51);">curl -X POST https://api.example.com/login \ -d "username=admin&password=secret"</font>,使用 <font style="color:rgb(44, 44, 54);">-X POST</font> 选项发送 POST 请求,并使用 <font style="color:rgb(44, 44, 54);">-d</font> 选项传递表单数据;
- 下载文件并保存本地:
<font style="color:rgb(51, 51, 51);">curl -o example.html https://www.example.com</font>,使用 <font style="color:rgb(44, 44, 54);">-o</font> 选项将下载的文件保存到指定的文件名;
- 显示详细信息:
<font style="color:rgb(51, 51, 51);">curl -v https://api.example.com</font>,使用 <font style="color:rgb(44, 44, 54);">-v</font> 选项启用详细模式,<font style="color:rgb(44, 44, 54);">curl</font> 会显示请求和响应的详细信息,包括请求头、响应头、状态码等;
posted @
2025-06-08 23:02
joudys
阅读(
35)
评论()
收藏
举报