<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[HTTP.makeRequest cannot POST binary buffers]]></title><description><![CDATA[<p dir="auto">I need to send a (small) form-encoded binary buffer (aka file upload) to a networked device from the hub (Firmware: 3.0.12).  I tried different ways  but couldn't manage to get it working.</p>
<p dir="auto">I checked with Wireshark, it looks like  the HUB is blindly converting   the 'options.content' value  to UTF 8  before posting it, regardless of the content-type.</p>
<ul>
<li>sending a string made of the buffer bytes<br />
=&gt; UTF8 corruption</li>
<li>sending data  as a  Uint8Array<br />
=&gt; the hub posts the string "[object Uint8Array ]"</li>
<li>setting various HTTP headers such as<br />
Content-Type: multipart/form-data; boundary=...<br />
Content-Type: application/octet-stream<br />
Content-Transfer-Encoding: binary<br />
=&gt; the hub doesn't care.</li>
</ul>
<p dir="auto">It there a way to go around this limitation / bug  ?</p>
]]></description><link>https://community.flic.io/topic/18254/http-makerequest-cannot-post-binary-buffers</link><generator>RSS for Node</generator><lastBuildDate>Mon, 15 Jun 2026 13:56:42 GMT</lastBuildDate><atom:link href="https://community.flic.io/topic/18254.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 27 Mar 2023 09:20:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to HTTP.makeRequest cannot POST binary buffers on Tue, 04 Apr 2023 14:41:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.flic.io/uid/2408">@martinm</a> When an incoming <code>FIN</code> packet is received from the remote endpoint, the socket is automatically properly closed unless the <code>allowHalfOpen</code> option is set. If that option is set, the socket is properly closed at the time when both an incoming <code>FIN</code> has been received and the local user has called the <code>end</code> method on the socket (in any order). Nothing is done at garbage collection time, so if you use the <code>allowHalfOpen</code> property, remember to close the socket by calling the <code>end</code> method. If the <code>allowHalfOpen</code> is not set, you can still use the <code>end</code> method to send your own <code>FIN</code> packet.</p>
]]></description><link>https://community.flic.io/post/20632</link><guid isPermaLink="true">https://community.flic.io/post/20632</guid><dc:creator><![CDATA[Emil]]></dc:creator><pubDate>Tue, 04 Apr 2023 14:41:54 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP.makeRequest cannot POST binary buffers on Tue, 04 Apr 2023 08:25:04 GMT]]></title><description><![CDATA[<p dir="auto">I dug a bit more with Wireshark. It looks like the socket is actually properly closed by the hub if socket.end() is not explicitly called.</p>
<p dir="auto">I suspect it is closed automatically when the Socket object is garbage collected.</p>
]]></description><link>https://community.flic.io/post/20630</link><guid isPermaLink="true">https://community.flic.io/post/20630</guid><dc:creator><![CDATA[martinm]]></dc:creator><pubDate>Tue, 04 Apr 2023 08:25:04 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP.makeRequest cannot POST binary buffers on Mon, 03 Apr 2023 05:54:15 GMT]]></title><description><![CDATA[<p dir="auto">martinm less than a minute ago<br />
<a class="plugin-mentions-user plugin-mentions-a" href="https://community.flic.io/uid/57">@Emil</a> ok, thanks I managed to make it work with the raw TCP API.</p>
<p dir="auto">Note that although mentioned in the "drain" callback details net.Socket.write() is not documented.</p>
<p dir="auto">Also, it looks like there is no way to properly close the socket ie once the data has been sent and acknowledged by the receiver. net.Socket.end() is not documented either and I suspect that "drain" doesn't wait for the ACK. May I count on the hub to properly clean up his stuff (no socket leak) once the socket has been closed by the other end ?</p>
<p dir="auto">BTW, coding network I/O with old school javascript (no async / await) is a pain.</p>
]]></description><link>https://community.flic.io/post/20625</link><guid isPermaLink="true">https://community.flic.io/post/20625</guid><dc:creator><![CDATA[martinm]]></dc:creator><pubDate>Mon, 03 Apr 2023 05:54:15 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP.makeRequest cannot POST binary buffers on Mon, 27 Mar 2023 13:40:22 GMT]]></title><description><![CDATA[<p dir="auto">Right now the http api is quite simplistic.</p>
<p dir="auto">As written in the api documentation, both the request body and response body have the data type "String". For now if you don't find a workaround you have to use the raw TCP API.</p>
<p dir="auto">It's likely this will be supported in a later version.</p>
]]></description><link>https://community.flic.io/post/20613</link><guid isPermaLink="true">https://community.flic.io/post/20613</guid><dc:creator><![CDATA[Emil]]></dc:creator><pubDate>Mon, 27 Mar 2023 13:40:22 GMT</pubDate></item></channel></rss>