Post topics, source code that relate to the Arduino Platform
User avatar
By treii28
#63982 Pretty much what the topic says. I'm playing with embedding small binaries and got stopped when the output from xxd -i didn't seem to match the format for WebServer.send() which expects string data.

meanwhile streamFile seems to expect a file handle (from an SD presumably)

So what's the best way to represent binary data and send it as a buffer like with streamFile? (Please include hints on where the header goes if you're jumping down layers of protocols in your answer - still new to C++ and I notice WebServer.cpp uses the WiFiClient.write() directly - still not clear on how those headers get the length right in there. I'm gzipping any 7-bit [text] data in the stuff I'm playing with to reduce the size, so I have to be sure to include the Encoding header so the browser knows it's compressed)

SW