Hi,
Has any of you sent files from Blue Prism to an external endpoint using HTTP request (post)?
I was wondering how to attach binary data to HTTP request using Utilty - HTTP object.
Any ideas?
Thanks
Arek
To send binary data over a rest webservice I would expect the data would need to be sent as some kind of text, potential within a JSON field using BASE64 text or something? Blue Prism provide the HTTP and JSON objects, i think the answer to this specific question about how best to structure your binary data within your JSON would probably require you to do some research on the internet.
Not that I know of, but it's simple enough to create your own object with a code stage and something like this (untested, but should give you a starting point at least):
var bytes = System.Convert.FromBase64String(encoded);
var decoded = System.Text.Encoding.UTF8.GetString(bytes);
It is an old post but I ran into the same issue. The solution is as follows:
1) Create a calculation stage with and look up File function called LoadBinaryFile
2) Provide Filepath and Store Result In (data item has to be Binary)
3) Pass the binary data item to your webservice
I will be glad if you let me know if it helped (press Like) :)
I tried this but the result was unsuccessful. I am trying to POST a file using Multi Part Form Data. But when I send the data as binary, I receive no response. Can you please let me know if this was successful to you?
If multipart/form-data doesn't work for you, you must be constructing a request in a wrong way. Maybe your boundary string appears in a file. Show us the code.
p.s. Server in general should not care how you encode data in most cases, but urlencoding big binary file might have a noticeable overhead.
I have attached few screen shots. It would great if anyone can help me out with this. I read somewhere that in body we just cannot give file path but we have to encode it.