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

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


curl -X POST  -F fieldNameHere=@myfile.html  http://myapi.com/

or

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

curl -F "fieldNameHere=@myfile.html"  http://myapi.com/


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://docs.microsoft.com/en-us/azure/digital-twins/how-to-add-blobs!