Clarification needed in constructing multi-part body with one non-binary data part and binary file part

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Clarification needed in constructing multi-part body with one non-binary data part and binary file part

Vasudevan Comandur
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


  

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Htmlunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-user
Reply | Threaded
Open this post in threaded view
|

Re: Clarification needed in constructing multi-part body with one non-binary data part and binary file part

jksenthilraja
send what are technology using your application.

On Tue, Jan 3, 2017 at 10:54 AM, Vasudevan Comandur <[hidden email]> wrote:
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


  

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Htmlunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-user



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Htmlunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-user