Linux common commands-84: curl

curl is a file transfer tool that can be uploaded or downloaded, and supports common protocols such as HTTP , HTTPS , and FTP . Backend developers often use it to test web interfaces.

Syntax format: chroot [parameter]

Common parameters:

Example

 # 获取网站源码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

This article is reprinted from https://xugaoxiang.com/2022/07/07/linux-cmds-84-curl/
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment