curl命令使用

curl http://localhost/action.php -I

curl http://localhost/action.php -X HEAD

multipart/form-data 形式的 form 上传文件

curl -F "filename=@/home/test/file.tar.gz" http://localhost/action.php

用 -d 参数,这时curl会以application/x-www-url-encoded 方式发送 POST 请求

curl -d "action=del&name=archer" -d "id=12" http://localhost/action.php

-F参数以name=value的方式来指定参数内容,如果值是一个文件,则需要以name=@file的方式来指定。

如果通过代理,上面的命令有可能会被代理拒绝,这时需要指定上传文件的MIME类型

curl -x myproxy.com:1080 -F "filename=@/home/test/file.tar.gz;type=application/octet-stream" http://localhost/action.php

相关推荐
model20051 天前
Alibaba linux 3安装LAMP(5)
linux·运维·服务器
哇哈哈&1 天前
安装wxWidgets3.2.0(编译高版本erlang的时候用,不如用rpm包),而且还需要高版本的gcc++19以上,已基本舍弃
linux·数据库·python
minihuabei1 天前
跨域拉镜像
linux
王 富贵1 天前
【Linux】防火墙常用命令(iptables/firewalld/ufw)
linux·运维·服务器
写代码的【黑咖啡】1 天前
Linux系统简介及常用命令分类详解
linux·运维·服务器
YFLICKERH1 天前
【Linux系统】ubuntu 25.04 虚拟机联网与DNS域名问题排查案例
linux·ubuntu25.04
松涛和鸣1 天前
DAY27 Linux File IO and Standard IO Explained: From Concepts to Practice
linux·运维·服务器·c语言·嵌入式硬件·ubuntu
GeniuswongAir1 天前
飞牛NAS死机排查
linux·运维·服务器
hhcgchpspk1 天前
linux查找并杀死进程部分方法
linux·运维·服务器·网络·经验分享
天上飞的粉红小猪1 天前
线程概念&&控制
linux·开发语言·c++