curl 指令发起 post请求
1.To upload a file via curl:
curl http://api.example.com/profile -F "image=@profile.jpg"
2.In php this will give you the profile.jpg in the $_FILES['image'], now to add additional field values you just add additional -F arguments like this:
curl http://api.example.com/profile -F "image=@profile.jpg" -F "phone=123456789"
3.To post simple field/value:
curl http://api.example.com/profile -d "phone=123456789&name=Hwei"
本文介绍了如何使用curl命令行工具发起POST请求,包括上传文件、发送简单字段值等操作,并展示了如何通过添加额外参数来传递多个字段。
8715

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



