using curl for multipart/form-data with a file upload

For more complex requests:

curl
 -X POST "YOUR_API_URL"
 -H "Authorization: Bearer YOUR_TOKEN"
 -H "Accept: application/json"
 -H "Content-Type: multipart/form-data"
 -F "meta={\"YOUR_ATTRIBUTE\": \"YOUR_DATA\"};type=application/json"
 -F "text=PATH_TO_FILE;type=text/plain"

You can set several chunks together into one request. For more, check out: https://learn.microsoft.com/en-us/azure/digital-twins/how-to-add-blobs!


curl -X POST  -F [email protected]  http://myapi.com/

or

-X POST is implied by -F (per comment), quotes are optional

curl -F "[email protected]"  http://myapi.com/

Tags:

Curl

Multipart