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.
create Mimedata
get file as stream
add body to mimedata
generated envelope stream.
used Put method to upload file. mapped envelope stream to data/mimestream.
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