简体   繁体   English

使用C ++ POST二进制数据

[英]POST binary data using C++

I have a binary file which I presume cannot be sent( using Wininet , POST method , C++ ) as such without encoding as base64. 我有一个二进制文件,我认为如果不将其编码为base64,则无法发送(使用Wininet,POST方法,C ++)。 In that case , the encoded data when received in the server side is not being decoded back to binary automatically, even after setting the request header "Content-Transfer-encoding : base64". 在那种情况下,即使在设置请求标头“ Content-Transfer-encoding:base64”之后,在服务器端接收到的编码数据也不会自动解码回二进制。 Can someone enlighten me the proper way of doing? 有人可以启发我正确的做事方法吗?

Note: I tried decoding in the server and it worked. 注意:我尝试在服务器中解码,但它可以正常工作。 Previous questions in Stackoverflow on the same topic is not answered properly. Stackoverflow中有关同一主题的先前问题未得到正确回答。

You can send binary data with POST requests just fine. 您可以发送带有POST请求的二进制数据就可以了。 The HTTP header specifies the length of the payload, which can be treated as a raw sequence of bytes. HTTP标头指定有效负载的长度,可以将其视为原始字节序列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM