欢迎访问我的网站,希望内容对您有用,感兴趣的可以加入免费知识星球。

Linux常用命令-84:curl

常用命令 迷途小书童 2年前 (2022-07-07) 785次浏览 0个评论

curl 是一个文件传输工具,可以上传也可以下载,支持 HTTPHTTPSFTP 等市面上常见的协议。后端开发者经常用它来测试 web 接口。

语法格式:chroot [参数]

常用参数:

linux curl

示例

# 获取网站源码
curl https://xugaoxiang.com

# 下载文件
curl -O https://xugaoxiang.com/download/test.jpg

# post上传文件
curl -F ‘data=@path/to/local/file’ UPLOAD_ADDRESS

# 以特定key参数上传文件
curl -F 'longjing=@/home/xugaoxiang/test.jpg' http://192.168.1.99:8888/uploadImageFile

#同时上传多个文件
curl -F 'fileX=@/path/to/fileX' -F 'fileY=@/path/to/fileY' ... http://localhost/upload
喜欢 (0)

您必须 登录 才能发表评论!