Forum Discussion

asheesh's avatar
asheesh
New Contributor
5 years ago

Execute Put With Attachment with Content-Type multipart/form-data

I have some issues for calling api
Here are details from Postman where i am able to call the api. But I am not sure how i can pass image data in Snap logic in Execute put snap?



Please give some suggestion. So that we can fix this.

4 Replies

    • asheesh's avatar
      asheesh
      New Contributor

      Thanks a lot, Supratim,

      As per the service provider, Put request should be a multi-part Form data and there are certain property about the image also needs to be sent, we are able to do it in Postman where all the Properties and Image are part of the Body, but we are not sure how to pass the same thing in Execute PUT Snap.

      We tried to test the Put snap without attachment as urlencoded, where we have created and url with all the properties as part of url, it was able pass the authentication and error was missing file.

      but if we add urlencoded and the upload file both at the same time we are getting Error 500.

      So we are not able to use properties and attachment with multi-form data.

      Please suggest,

      Here is the Attachment from POSTMAN

  • bojanvelevski's avatar
    bojanvelevski
    Valued Contributor

    Hi @asheesh,

    You can also use File Reader to read the image, and pass the content to the REST Put snap in the entity field.

    Regards,
    Bojan

  • sanjaynayak's avatar
    sanjaynayak
    New Contributor III

    Any one use rest put , content type has some issues , not generating boundary in run time
    multipart/form-data; boundary=.
    Even if hard code the boundary value in HTTP entity and as well as content type.

    Like post man is generating