From: Vasudevan C. <vco...@gm...> - 2017-01-03 10:54:43
|
Hi All, I am using HTML Unit 2.23. I want to connect to a salesforce application using API. I wanted to upload a file. I had created a dummy html and had an input=file. The server application is requiring a non-binary data in the multi-part having the body as follows --C0OW0SsOeogj2qmYveLXCaxTqYacthWM4q Content-Disposition: form-data; name="entity_document"; Content-Type: application/json {"Description" : "Sample document uploaded from SixthSense thru integration","Keywords" : "integrate,sixthsense,create","FolderId" : "00l28000000WRUp","Name" : "HARITHA_JAVA_DEVELOPER","Type" : "doc"} --C0OW0SsOeogj2qmYveLXCaxTqYacthWM4q Content-Disposition: form-data; name="Body"; filename="HARITHA_JAVA_DEVELOPER.doc" Content-Type: application/msword How do I construct the dummy HTML so that the content-type=application/json is set in the first multi-part? When I had two type=file entries in the dummy HTML, the server app rejects stating that it accepts only one binary. Appreciate your help in advance. Looking forward to your reply. Regards Vasu |