Home > Software engineering >  MFC using HTTP the SendRequest () content with Chinese characters
MFC using HTTP the SendRequest () content with Chinese characters

Time:09-18

Non-chinese can normal delivery, the Chinese would return 400, a great god, please give explanation, thank you,

CodePudding user response:

Try to UTF8
PFile - & gt; AddRequestHeaders (" content-type: text/XML. charset=utf-8");
//add the content of the Request to UTF8 in

CodePudding user response:

M_pFile - & gt; AddRequestHeaders (" Accept: */*, application/json ");
M_pFile - & gt; AddRequestHeaders (" Accept - Charset: UTF8 ");
M_pFile - & gt; AddRequestHeaders (" Accept - Language: useful - cn; Q=0.8, en. Q=0.6, ja. Q=0.4 ");
M_pFile - & gt; AddRequestHeaders (" content-type: application/json ");


M_pFile - & gt; The SendRequest (NULL, 0, (LPVOID) (LPCTSTR) strPostData, strPostData NULL=https://bbs.csdn.net/topics/=? 0: strlen (strPostData));

Could you speak a little bit more detailed? StrPostData input format is "zhang SAN 01" so, there are not a Chinese character, error no. 400, no Chinese characters can be successful,

CodePudding user response:

Convert strPostData content to UTF8

CodePudding user response:

I try to turn the turn after input in English is also wrong
  • Related