WinHttp.au3: #include-once
Global Const $HTTP_STATUS_OK = 200
Func HttpPost($sURL, $sData = "")
Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
$oHTTP.Open("POST", $sURL, False)
If (@error) Then Return SetError(1, 0, 0)
$oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
$oHTTP.Send($sData)
If (@error) Then Return SetError(2, 0, 0)
If ($oHTTP.Status <> $HTTP_STATUS_OK) Then Return SetError(3, 0, 0)
Return SetError(0, 0, $oHTTP.ResponseText)
EndFunc
Func HttpGet($sURL, $sData = "")
Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
$oHTTP.Open("GET", $sURL & "?" & $sData, False)
If (@error) Then Return SetError(1, 0, 0)
$oHTTP.Send()
If (@error) Then Return SetError(2, 0, 0)
If ($oHTTP.Status <> $HTTP_STATUS_OK) Then Return SetError(3, 0, 0)
Return SetError(0, 0, $oHTTP.ResponseText)
EndFunc Example 1: #include "WinHttp.au3"
Global $MD5 = HttpPost("http://www.afk-manager.ir/test/post.php", "password=WeWantThisAsMd5")
MsgBox(64, "MD5", $MD5) Example 2: #include "WinHttp.au3"
Global $sGet = HttpGet("http://www.google.com/")
FileWrite("Google.txt", $sGet) Speed compare: [WinHttp.WinHttpRequest.5.1 GET]
1 = 422.961162765649
2 = 455.738280639636
3 = 441.821516504421
4 = 390.538648365335
Total = 1711.059608275041
Average = 427.7649020687603
[WinHttp.WinHttpRequest.5.1 POST]
1 = 826.436200956633
2 = 872.366642546045
3 = 871.266802895081
4 = 875.792832686324
Total = 3445.862479084083
Average = 861.4656197710208
[HTTP UDF GET]
1 = 984.282912132673
2 = 813.896511915435
3 = 781.158836566862
4 = 791.901235916364
Total = 3371.239496531334
Average = 842.8098741328335
[HTTP UDF POST]
1 = 788.734835486743
2 = 975.688234142967
3 = 785.810779035388
4 = 847.537193542955
Total = 3397.771042208053
Average = 849.4427605520133
[InetRead GET]
1 = 672.120733570292
2 = 595.221462195098
3 = 561.122261209642
4 = 738.180516302658
Total = 2566.64497327769
Average = 641.6612433194225 Tests result: Server 2003 32bit OK
Server 2003 64bit Not Tested
Server 2008 32bit Not Tested
Server 2008 64bit OK
XP 32bit OK
XP 64bit Not Tested
Vista 32bit Not Tested
Vista 64bit Not Tested
7 32bit OK
7 64bit OK
8 32bit OK
8 64bit OK Are you interested? Check this out: http://msdn.microsoft.com/en-us/library/windows/desktop/aa384106(v=vs.85).aspx