I want to send a json request and multiple files in one HTTP request. I am using multipart/mixed request for this
curl -H "Content-Type: multipart/mixed" -F " request=@body.json ; type=application/json" -F " file1=@2.xml " -F " file2=@2.pdf " -X POST hostName
Field
request is of the content type application/json , and by this sign I determine that this part is a json request, and the other parts are files.
My question is how to embed the request body in a curl request. I'm trying to use
curl -H "Content-Type: multipart/mixed" -F "request={"param1": "value1"}" -F " file1=@2.xml " -F " file2=@2.pdf " -X POST hostName
but the request content type will be plain/text
source share