cURL / How to make a POST request

With fields:
curl --data "param1=value1&param2=value2" https://example.com/resource.cgi

Multipart:
curl --form "fileupload=@my-file.txt" https://example.com/resource.cgi

Multipart with fields and a filename:
curl --form "fileupload=@my-file.txt;filename=desired-filename.txt" --form param1=value1 --form param2=value2 https://example.com/resource.cgi

Without data:
curl --data '' https://example.com/resource.cgi 
curl -X POST https://example.com/resource.cgi 
curl --request POST https://example.com/resource.cgi

No comments:

Post a Comment