upload file using http put methods


I want to upload a file to https URL using put method. I tried creating mime and getting 403 forbidden response.

when tested to upload file using POSTMAN app, I’m able to upload file to target http server. but from webmethods pub.client.http service I’m unable to implement. Followed below steps.

  1. create Mimedata
  2. get file as stream
  3. add body to mimedata
  4. generated envelope stream.
  5. used Put method to upload file. mapped envelope stream to data/mimestream.

Am I missing any step? Please help.

I have found that the mime creation tools in web methods do not account for the need to include the boundary attribute in the http header when posting a mime message. To get around this, I take the envelopeStream created and convert it to bytes. Take the bytes and convert to string to get the boundary info, then apply the boundary manually to the http post header content-type.

on a guide to build the mime message correctly look under delivered wm samples: 20150305113048111_000_WmSamples - sample.mime:build_MultipartMIME

hope this helps.

R u getting any errors and share your flow in html format? This will help u to assist.