Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the difference between curl --upload-file and curl --form file=@filename

What is the difference between curl --upload-file and curl --form file=@/path/file? How the HTTP request be different for these?

like image 220
Jeeva Avatar asked Oct 31 '25 07:10

Jeeva


1 Answers

--upload-file

(with a HTTP or HTTPS URL) makes curl send an HTTP PUT request.

--form

makes curl send a HTTP POST request with a multipart formpost body.

like image 188
Daniel Stenberg Avatar answered Nov 02 '25 23:11

Daniel Stenberg