Jump to content
Sign in to follow this  
ThuongTin

Error with WinHttp.WinHttpRequest.5.1

Recommended Posts

ThuongTin

Func Get($pUrl, $pUserAgent = "Googlebot", $pReferer = "http://google.com", $pAUser = "", $pAPass = "", $pProxy="", $pCookie = "")
    $oHttpRequest = ObjCreate("WinHttp.WinHttpRequest.5.1")
    $oHttpRequest.SetTimeouts(30000, 30000, 30000, 30000)
    $oHttpRequest.SetProxy(2, $pProxy)
    $oHttpRequest.Option(4)
    $oHttpRequest.Open("GET", $pUrl, False)
    If $pAUser <> "" And $pAPass <> "" Then
        $oHttpRequest.SetCredentials($pAUser, $pAPass, 0)
    EndIf
    $oHttpRequest.setRequestHeader("User-Agent", $pUserAgent)
    $oHttpRequest.setRequestHeader("Accept-Language", "en-us,en;q=0.5")
    $oHttpRequest.setRequestHeader("Accept-Encoding", "gzip,deflate")
    $oHttpRequest.setRequestHeader("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7")
    $oHttpRequest.setRequestHeader("Connection", "Keep-Alive")
    $oHttpRequest.setRequestHeader("Referer", $pReferer)
    If $pCookie <> "" Then
        $oHttpRequest.setRequestHeader("Cookie", $pCookie)
    EndIf
    $oHttpRequest.Send()
    $noidung = $oHttpRequest.ResponseText
    Sleep(100)
    $oHttpRequest = ""
EndFunc  ;==>Post

C:\Documents and Settings\Thuong Tin\My Documents\T2 Boost\ddos.au3 (104) : ==> The requested action with this object has failed.:

$oHttpRequest.Send()

$oHttpRequest.Send()^ ERROR

Please help me!

Share this post


Link to post
Share on other sites
DjDeep00

@Thương Tín...Error handler should tell you whats up...

Global $oMyError = ObjEvent("AutoIt.Error","MyErrFunc")

Func MyErrFunc()
Local $HexNumber
Local $strMsg

$HexNumber = Hex($oMyError.Number, 8)
$strMsg = "Error Number: " & $HexNumber & @CRLF
$strMsg &= "WinDescription: " & $oMyError.WinDescription & @CRLF
$strMsg &= "Script Line: " & $oMyError.ScriptLine & @CRLF
MsgBox(0, "ERROR", $strMsg)
SetError(1)
Endfunc

Edit: Updated to the correct name.

Edited by DjDeep00

Share this post


Link to post
Share on other sites
ThuongTin

Oh Yeah! Thanks you very much.

My name is Thuong Tin (Thương Tín) not ThongTin. I'm Vietnames ^ ^

Thanks you, thanks you!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.