LPSTR HttpRequest::Post( LPSTR path,LPSTR args )
{ SendFormat("POST %s HTTP/1.1",path);
SendFormat("Host: %s",m_hostName);
SendFormat("User-Agent: %s","Kutu/1.0 (Windows)");
connection->SendLine("Keep-Alive: 115");
connection->SendLine("Connection: keep-alive");
connection->SendLine("Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
connection->SendLine("Accept-Language: zh-cn,zh;q=0.5");
connection->SendLine("Accept-Charset: utf-8;q=0.7,*;q=0.7");
connection->SendLine("Content-Type: application/x-www-form-urlencoded");
CHAR dataLen[6];
sprintf(dataLen,"%d",strlen(args));
connection->Send("Content-Length: ");
connection->SendLine(dataLen);
connection->SendLine("");
connection->Send(args);
char *tmpBuffer = new char[1024];
char * defMem;
char * prevMem;
defMem=prevMem=NULL;
ULONG totalSize=0;
int  curSize=0;
int preSize = 0;
while((curSize=connection->Receive(tmpBuffer))!=0){ totalSize += curSize;
defMem=(char*)VirtualAlloc(NULL,totalSize,MEM_COMMIT,PAGE_READWRITE); if(prevMem!=NULL){
CopyMemory(defMem,prevMem,preSize); VirtualFree(prevMem,preSize,MEM_DECOMMIT);
}
CopyMemory(defMem+preSize,tmpBuffer,curSize);
preSize += curSize;
prevMem = defMem;
} delete []tmpBuffer;
tmpBuffer = NULL; int len=MultiByteToWideChar(CP_UTF8, 0, defMem, -1, NULL,0); 
unsigned short* wszGBK = new unsigned short[len+1];       
memset(wszGBK, 0, len * 2 + 2); 
MultiByteToWideChar(CP_UTF8, 0,defMem, -1, (LPWSTR)wszGBK, len); 
len = WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)wszGBK, -1, NULL, 0, NULL, NULL); 
char *szGBK=new char[len+1]; 
memset(szGBK, 0, len+1); 
WideCharToMultiByte (CP_ACP, 0, (LPCWSTR)wszGBK, -1, (LPSTR)szGBK, len, NULL,NULL); 
VirtualFree(defMem,totalSize,MEM_DECOMMIT);
delete []wszGBK;
wszGBK = NULL;
return szGBK;
}
HttpRequest* request = new HttpRequest("127.0.0.1:1432");
 char* result = request->Post("/WebSite3/Default.aspx","测试");
request->Close();

delete result;<----------报错  无法删除该字符串
delete request;