
Hi,
I've seen from other posts that it should be possible to PUT a binary payload using the HTTPRequest class - my code looks like this:
HTTPRequest http_request(requestUri);
http_request.setMethod("PUT");
http_request.setContentType("application/octet-stream");
http_request.setContentLength(contentLength);
char* contentBuffer = http_request.createContentBuffer();
memcpy((void*)contentBuffer, content, contentLength);
http_request.send(*tcp_conn, error_code);
Will this work? I noticed the setContents() method expects a std::string so I'm nervous that Pion's HTTPRequest class can't support this - also the content type in HTTPTypes doesn't include the octet-stream encoding. I'm seeing some wierd errors in my code which may or may not be due to the encoding of the binary payload.
Can somebody confirm I can indeed PUT binary data to a Pion HTTPServer or point out any problems with the above?
Many thanks,
Jas.
