Skip to content

Instantly share code, notes, and snippets.

@wwwins
Last active January 15, 2021 08:20
Show Gist options
  • Save wwwins/745845a49adc706fa43207cf0787cde2 to your computer and use it in GitHub Desktop.
Save wwwins/745845a49adc706fa43207cf0787cde2 to your computer and use it in GitHub Desktop.
curl tips
# POST multipart/form-data with a file upload
curl --request POST --url https://postman-echo.com/post -F "foo1=bar1" -F "foo2=bar2" -F "image=@/Users/isobar/Downloads/radar.jpg"
## POST multipart/form-data with json string
curl --request POST --url https://postman-echo.com/post -F "json=$jsonString"
# POST on windows
curl --request POST --url https://xxxxxx.ngrok.io/upload/ -F "filename=@d:\Data\My documents\Processing\mySample_http_post\test.tif"
# POST binary data with a file upload
curl --binary-data '@output.mp4' http://localhost:8080/
# POST json data
curl --header "Content-Type: application/json" --request POST --data '{"issue_no":"123456789","redeem_time":"2019-09-27 12:32", "redeem_method":"stamp"}' http://localhost:19006/redeem/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment