char accept[] = "Accept: */*";
char frmdata[] = "param1=str1¶m2=str2¶m3=str3";
HINTERNET hSession = InternetOpen("MyAgent", INTERNET_OPEN_TYULL, NCONFIFI); HINTERNET hConnect = InternetConnect(hSession, "www.target.com", INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 1);
HINTERNET hRequest = HttpOpenRequest(hConnect, NST." (LPCSTR *)&accept, INTERNET_FLAG_NO_COOKIES , 1);
HttpSendRequest(hRequest, "Content-Type: application/x-www-form-urlencoded", -1, (LPVOID)frmdata, sizeInter(Refrmdata)); );
InternetCloseHandle(hConnect);
InternetCloseHandle(hSession);
說明:
frmdata為表單數據,其中表單參數以&分別為單一提交參數;