Forum Discussion
nmrao
7 years agoChampion Level 3
You need to use right Media-Type in the request.
- Shashavali7 years agoContributor
nmrao - Thank you very much for the reply.
After discussing with dev team, i got to know that i have to use Media Type as 'multipart/form-data'.
It will be a great help if you share an example how to write body data dynamically of multipart/form-data.
Below is the payload which i can see in chrome console
------WebKitFormBoundaryx5wcwgn0MRYwf1Z2 Content-Disposition: form-data; name="fileType" DCA_FILE ------WebKitFormBoundaryx5wcwgn0MRYwf1Z2 Content-Disposition: form-data; name="DCA_FILE"; filename="Orion DCA.csv" Content-Type: application/vnd.ms-excel ------WebKitFormBoundaryx5wcwgn0MRYwf1Z2 Content-Disposition: form-data; name="projectId" 5a3aa07d8058f37f26f10831 ------WebKitFormBoundaryx5wcwgn0MRYwf1Z2 Content-Disposition: form-data; name="columnMapTemplate" {"mappings":{"make":"deviceType":"","hasColor":"","location":"","country":"","site":"","building":"","floor":"","subEnvId":"","stapleTotalLastReading":"","notes":""},"name":"defaultTemplate"} ------WebKitFormBoundaryx5wcwgn0MRYwf1Z2--
Thanks a lot in advance.