question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

It's not possible to send binary data with the HttpSend activity

See original GitHub issue

Github issues should be used for bugs and feature requests. Use Stack Overflow for general “how-to” questions.

Version

Latest

Describe the bug

It’s not possible to send binary data with the HttpSend activity

To Reproduce

Steps to reproduce the behavior:

  1. Add a property to assign a binary value using an expression. You can use base64ToBinary as an example =base64ToBinary("<base 64 string>")
  2. Add a http send activity, try to use the above property in the body (using an expression) e.g. =dialog.myBinaryData
  3. Observe the output, you will see that it just posts the value Byte[].

Its because its converting the data to string content before posting here

https://github.com/microsoft/botbuilder-dotnet/blob/main/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Actions/HttpRequest.cs#L296

Expected behavior

It should allow you to post binary content.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
stevkancommented, Aug 18, 2022

@jamesemann - Thank you for your patience. I was able to repro the issue you are encountering. I’ve been testing the above and have found that the values do appear to be in the created object. If you pass in an index value like dialog.myBinaryData[0], it will return a value for that index location. You could convert myBinaryData to an array using something like subArray, which works, but then it is no longer a binary array which I’m guessing you want for the HttpSend action.

In the meantime, I need to test a few more scenarios and then connect with one of the devs on this. I will keep you posted when I know more. Based on the above info, if you should find a workaround, please let me know.

1reaction
stevkancommented, Aug 13, 2022

@jamesemann - Thank you for reporting this. I’ll investigate and let you know what I find.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sending binary data over http
HTTP is perfectly capable of handling binary data: images are sent over HTTP all the time, and they're binary. People upload and download...
Read more >
POST a binary data file to 3rd party application
Hi, I am new to the REST API in Salesforce. I have to POST a binary csv file to the 3rd party application...
Read more >
Sending and Receiving Binary Data - Web APIs | MDN
Sending binary data ​​ The send method of the XMLHttpRequest has been extended to enable easy transmission of binary data by accepting an ......
Read more >
Failure to send binary data greather than 64KB using ...
I'm trying to send an image to an Azure vision endpoint. The data stored in the DB ... httpPost to send arbitrary data...
Read more >
curl.1 the man page
Name. curl - transfer a URL. Synopsis. curl [options / URLs]. Description. curl is a tool for transferring data from or to a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found