awscurl
awscurl copied to clipboard
Plans to add multipart requests support?
What do you think about adding multipart/form-data
requests that are made with -F
option in curl?
It would be awesome for testing endpoints for file uploads that are located on API Gateways with AWS Auth enabled.
Example [aws]curl command:
awscurl \
-X POST \
-H "Content-Type: multipart/form-data" \
-F "field1=value1" \
-F 'field2={"some":"json"};type=application/json' \
-F "file=@/path/to/some/picture.png" \
https://redacted.execute-api.us-west-2.amazonaws.com/path
Expected request body:
--------------------------d9afcbc8f3fe869a
Content-Disposition: form-data; name="field1"
value1
--------------------------d9afcbc8f3fe869a
Content-Disposition: form-data; name="field2"
Content-Type: application/json
{"some":"json"}
--------------------------d9afcbc8f3fe869a
Content-Disposition: form-data; name="file"; filename="picture.png"
Content-Type: image/png
<binary data>
--------------------------d9afcbc8f3fe869a--
Looks rather interesting: https://curl.se/docs/manpage.html#-F
@Envek would you like to start a PR or how would you like to move it forward?
I'm not proficient in Python, unfortunately. Probably won't be able to dive into it in the nearest future.