Dim __a As Long, __b As Long, __c As Long
Dim bRet As Boolean, lpszPostData As String, sHeader As String, sBuff As String * 1024
__a = InternetOpen("test_post_data", 0, vbNullString, vbNullString, 0)
If __a <> 0 Then
__b = InternetConnect(__a, "domainname.com", 80, "", "", 3, 0, 0)
If __b <> 0 Then
__c = HttpOpenRequest(__b, "POST", "/test.aspx", "HTTP/1.0", vbNullString, 0, -2147483648#, 0)
If __c <> 0 Then
sHeader = "Content-Type: application/x-www-form-urlencoded" & vbCrLf
bRet = HttpAddRequestHeaders(__c, sHeader, Len(sHeader), -1610612736)
lpszPostData = "param1=" & param1 & "¶m2=" & param2
bRet = HttpSendRequest(__c, vbNullString, 0, lpszPostData, Len(lpszPostData))
If bRet Then
If (HttpQueryInfo(__c, 5, sBuff, 1024, 0) = 1) Then
'You can get response of page in [sBuff]
End If
End If
bRet = InternetCloseHandle(__c)
End If
bRet = InternetCloseHandle(__b)
End If
bRet = InternetCloseHandle(__a)
End If
' Yuo must to include api in your module also...