You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
http.put('http://example.com/api/v1/target',
'Content-Type: application/octet-stream\r\n',
payload,
function(code, data)
if (code < 0) then
print("HTTP request failed")
else
print(code, data)
end
end)
The payload sent is always cut off after the first "0" byte in the payload stream. How can I send binary data?
PS: I think the problem is buried in line 194 of http_client.c
if ( req->post_data != NULL ) /* If there is data then add Content-Length header. */ {
os_sprintf( post_headers, "Content-Length: %d\r\n", strlen( req->post_data ) );
}
strlen takes the 0 byte seriously...
PPS: The GET API has no problem with binary data at all...
PPPS: And your module is that fixed on "strlen(blabla)", that I suppose it will not be possible at all...
The text was updated successfully, but these errors were encountered:
Hi,
trying to HTTP PUT a binary buffer.
The payload sent is always cut off after the first "0" byte in the payload stream. How can I send binary data?
PS: I think the problem is buried in line 194 of http_client.c
strlen takes the 0 byte seriously...
PPS: The GET API has no problem with binary data at all...
PPPS: And your module is that fixed on "strlen(blabla)", that I suppose it will not be possible at all...
The text was updated successfully, but these errors were encountered: