Jump to content

Error with WinHttp.WinHttpRequest.5.1


Recommended Posts

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!

Link to comment
Share on other sites

@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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...