REST API Design sending JSON data and a file to the api in same request
问题 I am creating a REST API on top of an existing application. One of the features takes in a json data along with a file uploaded by the user. I am unsure how to send a file AND json data in the same request to the REST API? I have the json part working and I test that using curl: curl -XPOST http://localhost:8080/myapp/foo -d '{"mydata": { "name": "somename", "gender": "male" }}' //I would like to send an image (say, profile image) with the above request as well. I'm using a grails application