wininet issue
-
I am using the following code example (found on code project), but the page returned in page1 is www.codeproject.com/info/search.aspx and not www.codeproject.com/info/search.aspx?artkw=wininet.
#include "afxinet.h" CInternetSession sess; CHttpConnection* pHttpConnection1 = sess.GetHttpConnection(_T("www.codeproject.com")); CHttpFile* pFile1 = pHttpConnection1->OpenRequest(_T("POST"), _T("/info/search.aspx")); CString header1 = _T("Content-Type: application/x-www-form-urlencoded"); CString mdata1 = _T("artkw=wininet"); pFile1->SendRequest(header1, header1.GetLength(), (LPVOID)(LPCTSTR)mdata1, mdata1.GetLength()); DWORD dwRet1; CString page1; pFile1->QueryInfoStatusCode(dwRet1); if (dwRet1 == HTTP_STATUS_OK){ char buf12[999999]; pFile1->Read(buf12, 999999); page1 = buf12; }
I found this code here: http://www.codeproject.com/script/Forums/View.aspx?fid=1647&msg=1603553[^] What am I doing wrong? :sigh:Lucky