Jump to content
Sign in to follow this  

HTTPRequest and ResponseText

Recommended Posts


Here is a link to a picture of my desktop which shows all the code and the output.

Posted Image

As you can see in wireshark the server is sending me back a packet which details the success of the login attempt however the AutoIt output is giving me pretty much nothing. This script use to work (sometimes) and sometimes this problem occurred.

Anyone know what's going on?

#include "md5.au3"

Global $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")

$username = "user"

$password = "pass"

$password_MD5 = md5($password)

Func _HTTPRequest($oHTTP, $oMethod, $oURL, $oData = "")

$oHTTP.Open($oMethod, $oURL, False)

$oHTTP.SetRequestHeader("User-Agent", "S2 Games/Heroes of Newerth/")

$oHTTP.SetRequestHeader("Accept-Encoding", "gzip, deflate")

$oHTTP.SetRequestHeader("Connection", "Close")

$oHTTP.SetRequestHeader("Accept", "*/*")

If $oMethod = "POST" Then

$oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")



ConsoleWrite("STATUS:" & @CRLF)

ConsoleWrite($oHTTP.status & @CRLF)

ConsoleWrite($oHTTP.statustext & @CRLF)

ConsoleWrite("HEADERS:" & @CRLF)

ConsoleWrite($oHTTP.GetAllResponseHeaders() & @CRLF)

ConsoleWrite("RESPONSE:" & @CRLF)

ConsoleWrite($oHTTP.ResponseText & @CRLF)

Return $oHTTP.ResponseText()


$url = ""

;url = "http://masterserver.hon.s2games.com/client_requester.php"

$data = "f=auth&login=" & $username & "&password=" & $password_MD5

$httpReturn = _HTTPRequest($oHTTP, "POST", $url, $data)


;If StringInStr($httpReturn, "Invalid") Then

;ConsoleWrite("Fail" & @CRLF)


;If StringInStr($httpReturn, "super_id") Then

;ConsoleWrite("Success" & @CRLF)


If stringlen($httpReturn) > 100 Then

ConsoleWrite("Success" & @CRLF)


ConsoleWrite("Fail" & @CRLF)


Edited by xbayrockx

Share this post

Link to post
Share on other sites
This topic is now closed to further replies.
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.