data content with Postman Chrome extension
I'm struggling with creating POST multipart/mixed request with Postman Chrome extension. I keep getting HTTP 500.
Already gone through this question, but sadly solution doesn't works for me.
Here is my curl request which works for me.
curl -H "Content-Type: multipart/form-data" -F "merchantLogo=@offerlogo-320-320.png; type=image/png" -F "merchantDetails=@merchant.json; type=application/json" -X PATCH localhost:5000/api/merchants/57035bda0c74362faf5937f2/details -i -v
And when I use Postman
I am getting such response
{"code": 500,
"message": "There was an error processing your request. It has been logged (ID 034bec7815baca2e)."}
Request headers being passed from postman.
Somehow, the merchantDetails are always being passed as null when calling from POSTMAN and is passed properly when making call from curl.
Any help would be much appreciated.
EDITED 1:
My request from POSTMAN copied as curl,
curl 'http://localhost:5000/api/merchants/5714d8e060b2a79e62227d1a/details' -X PATCH -H 'Pragma: no-cache' -H 'Origin: chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm' -H 'Accept-Encoding: gzip, deflate, sdch' -H 'Accept-Language: en-GB,en-US;q=0.8,en;q=0.6' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36' -H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryxRZ6VKzFV40ZFIsd' -H 'Accept: /' -H 'Cache-Control: no-cache' -H 'Cookie: JSESSIONID=1ofut8bbydk491k2s80i4rowed; JSESSIONID=yg4l9zpjs5oj1xaqnuo44ehp6' -H 'Connection: keep-alive' --data-binary $'------WebKitFormBoundaryxRZ6VKzFV40ZFIsdrnContent-Disposition: form-data; name="merchantDetails"; filename="merchant.json"rnContent-Type: application/octet-streamrnrnrn------WebKitFormBoundaryxRZ6VKzFV40ZFIsdrnContent-Disposition: form-data; name="merchantLogo"; filename="offerlogo-320-320.png"rnContent-Type: image/pngrnrnrn------WebKitFormBoundaryxRZ6VKzFV40ZFIsd--rn' --compressed
链接地址: http://www.djcxy.com/p/48794.html