如何使用CHttpFile发送动作字符串参数? 这是我的代码
CInternetSession session(_T("My Session"));
CHttpConnection* pServer = NULL;
CHttpFile* pFile = NULL;
try
{
CString strServerName = _T("192.168.1.39");
CString szHeaders = _T("Content-Type: text/plain");
//To Be Send
**CString strFormData _T("action=setCameraSetting&videoOverlay.useTimestamp=1&videoOverlay.useText=1&videoOverlay.displayString=12.12-77.32");**
INTERNET_PORT nPort = 1039;
DWORD dwRet;
CString strObject = _T("/cgi-bin/camera.cgi");
pServer = session.GetHttpConnection(strServerName, nPort, _T(""), _T(""));
pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_POST, strObject);
pFile->AddRequestHeaders(szHeaders);
pFile->SendRequest();
pFile->QueryInfoStatusCode(dwRet);
delete pFile;
delete pServer;
}
catch (CInternetException* pEx)
{}
session.Close();
我为此获得了响应代码200 ..