|
我们的网站是使用二进制格式进行数据传输,目前我可以提交二进制数据到服务器,但是查看运行日志中的response内容,返回的二进制内容被解释成了ASCII码和中文,使用web_reg_save_param关联后进行编码转换也依然是乱码,不是需要的二进制数据,同时我也试了将关联的参数存入一个缓冲区,但是存入缓冲区的数据也不是需要的二进制数据,希望大家能够帮帮忙,多谢多谢
具体代码如下:
- int nPos = 0;
- char *pParam = NULL;
- char *pCode = "C63F4774747443E0884007A90B6C0603";
- pParam = (char*)malloc(44);
- *(int*)(pParam + nPos) = 38;
- nPos += 4;
- *(short*)(pParam + nPos) = 120;
- nPos += 2;
- *(int*)(pParam + nPos) = 0;
- nPos += 4;
- *(short*)(pParam + nPos) = 32;
- nPos += 2;
- memcpy(pParam + nPos,pCode,32);
- web_reg_save_param("Scode",
- "LB/BIN=\r\n",
- "RB/BIN=",
- "Ord=1",
- "Search=All",
- LAST);
- web_custom_request("Login",
- "URL=http://192.168.1.209/dll/dp.dll",
- "Method=POST",
- RAW_BODY_START,
- pParam,
- 44,
- RAW_BODY_END,
- LAST);
复制代码 Replay log的内容为:
Action.c(105): HTTP/1.1 200 OK\r\n
Action.c(105): Content-Length: 16\r\n
Action.c(105): Content-Type: application/octet-stream\r\n
Action.c(105): Server: Microsoft-IIS/7.0\r\n
Action.c(105): X-Powered-By: ASP.NET\r\n
Action.c(105): Date: Fri, 22 Jul 2011 02:06:15 GMT\r\n
Action.c(105): \r\n
Action.c(105): t=33733ms: 16-byte response body for "http://192.168.1.209/dll/dp.dll" (RelFrameId=1, Internal ID=24)
Action.c(105): \n
Action.c(105): \x00\x00\x00\x00\x00潠\x98\x00A\x00\x00\x00\x01\x06
Action.c(105): HTML parsing not performed for Content-Type "application/octet-stream" ("arseHtmlContentType" Run-Time Setting is "TEXT"). URL="http://192.168.1.209/dll/dp.dll" [MsgId: MMSG-26548]
Action.c(105): Notify: Saving Parameter "Scode = \n\x00\x00\x00\x00\x00潠\x98\x00A\x00\x00\x00\x01\x06"
Action.c(105): web_custom_request("Login") was successful, 16 body bytes, 166 header bytes [MsgId: MMSG-26386]
其中红色内容是需要的内容,一共16个字节。
请问各位,我如何能正确的获取到这16个字节的二进制数据? |
|