Skip to content

Instantly share code, notes, and snippets.

@innerverse
Created August 21, 2015 20:54
Show Gist options
  • Save innerverse/bbe397abac9749afcc97 to your computer and use it in GitHub Desktop.
Save innerverse/bbe397abac9749afcc97 to your computer and use it in GitHub Desktop.
Multipart curl example
# Auth
curl -i -H "Content-Type: application/json" -X POST -d @/home/seth/cred.json http://localhost:8080/api/v1/user/authenticate
# Pass auth token, json field, and binary file via REST
curl -i -H "Content-Type: multipart/form-data" -H "session-id: e862a33febfc77d0eff87d35d7fb66314580a2d2" -X POST http://localhost:8080/api/v1/send-error-report -F "errorReport=@/home/seth/pr.json;type=application/json" -F "file=@/home/seth/pr.zip;type=application/octet-stream"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment