For posting data:
curl --data "param1=value1¶m2=value2"
For file upload:
-F/--form Specify HTTP multipart POST data (H)
fieldName是指字段名
curl -F "fieldNameHere=@myfile.html"
curl --form "fileupload=@filename.txt"
curl -H "Content-Type: multipart/related" --form "data=@example.jpg;type=image/jpeg"
curl -X POST -F 'image=@/path/to/pictures/picture.jpg'
RESTful HTTP Post:
curl -X POST -d @filename
For logging into a site (auth):
curl -d "username=admin&password=admin&submit=Login" --dump-header headers
curl -L -b headers
阅读(1441) | 评论(0) | 转发(0) |