POST a file with curl
24 Aug 2023 · TricksHere is a small snippet I used today to send some files using curl. I usually use Postman to test my API, but it failed miserably to send a couple of files. Here is what I did using curl.
curl \
-X POST -H "Accept: application/json" \
-F 'attachments[][email protected]' \
-F 'attachments[][email protected]' \
-F 'body=hello world' \
myapi.test/api/endpoint