Jump to content
Sign in to follow this  
Zoli_cr0

HTTP quit don't work

Recommended Posts

Zoli_cr0

Hi all,

recentrly I upgraded my Autoit to 3.3.14.2, since then my function don't work, the compiler return an error at $oHTTP.Quit :

"C:\Program Files (x86)\AutoIt3\Include\odc.au3" (37) : ==> The requested action with this object has failed.:
$oHTTP.Quit
$oHTTP^ ERROR

With version 3.3.12 this UDF work's perfectly, please help me to figgure out why don't work as expected

func ODC_comm(byref $DES_Link, ByRef $xml_string)
    $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
    $oHTTP.Open("Post", $DES_Link , False)
    $oHTTP.Send($xml_string)
    $Response = $oHTTP.ResponseText
    $StatusCode = $oHTTP.Status
    $oHTTP.Quit
    $oHTTP = 0
    Return $Response
EndFunc

 

Thx

 

 

Edited by Zoli_cr0

Share this post


Link to post
Share on other sites
badcoder123

Maybe you need the parentheses? I generally use javascript for this but I think what you want it

$oHTTP.quit()

 

Share this post


Link to post
Share on other sites
ripdad

This page at MSDN shows Events, Methods and Properties of the WinHttpRequest object...

https://msdn.microsoft.com/en-us/library/windows/desktop/aa384106(v=vs.85).aspx

There is not a QUIT method.
So, your calling a method that doesn't exist and the result is an error.

There is an ABORT method, but it's not the same thing.


"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites
badcoder123
$ie = ObjCreate("InternetExplorer.Application")

With $ie
   .quit()
EndWith

I'd assume you're using Internet Explorer so you could use this... Another alternative is to WinClose($hWnd) if you're trying to quit/end the process.

Share this post


Link to post
Share on other sites
ripdad

Just returning from the function will destroy the WinHttpRequest object.

If you don't trust that, you could null the object...
$oHTTP = "" or $oHTTP = 0,
which you did in the first post.


"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

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.