Skip to content

Instantly share code, notes, and snippets.

@jrichardsz
Created October 17, 2017 17:11
Show Gist options
  • Select an option

  • Save jrichardsz/a31839a35eaed6c3e1ca7a6c818a619f to your computer and use it in GitHub Desktop.

Select an option

Save jrichardsz/a31839a35eaed6c3e1ca7a6c818a619f to your computer and use it in GitHub Desktop.
Posting a File and Json Data
# funciono : file + json
curl -X POST -F "jsonPayload=@/c/Users/lala/Desktop/payload.json" -F "fileName=lala-2017.xlsx" -F "image=@/c/Users/lala/Desktop/input.txt" http://localhost:9090/upload
# funciono : json + file
curl -v POST \
-H 'Accept: application/json' \
-H 'Content-Type: multipart/form-data' \
--form-string 'data={"id": 42}' \
-F 'file=@/c/Users/lala/Desktop/input.txt' \
'http://localhost:9090/upload'
# funciono : json + file
curl POST \
-H 'Accept: application/json' \
-H 'Content-Type: multipart/form-data' \
--form-string 'data={"id": 42}' \
-F 'file=@/c/Users/lala/Desktop/input.txt' \
'http://localhost:9090/upload'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment