I have a simple question regarding to the usage of cURL. Didn't find much during my Google search or Man page to get a clear answer.
In here talks about using either --data vs --form on sending file/attachment. I'm curious to know what are the main difference and under what scenarios you would pick --data-binary VS --form ?
The POST "body" can be sent via either --data (for application/x-www-form-urlencoded) or --form (for multipart/form-data):
-F "foo=bar" # 'foo' value is 'bar'
-F "foo=<foovalue.txt" # the specified file is sent as plain text input
-F "[email protected]" # the specified file is sent as an attachment
-d "foo=bar"
-d "foo=<foovalue.txt"
-d "[email protected]"
-d "@entirebody.txt" # the specified file is used as the POST body
--data-binary "@binarybody.jpg"