https://beamtic.com/http-requests-autoit
Le but de l'exercice consiste a se loguer sur le site :
http://beamtic.com/Examples/http-post.php
Si l'on est pas loggué, le site retourne :
Par contre si l'on est loggué, le site retourne :Is this your first time here? Why not tell us about yourself?
Donc je cherche a me logger avec ce code :Hallo Jacob Your best bench of 150 appears valid.
$sPD = 'name=Jacob&bench=150'
; Creating the object
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("POST", "http://beamtic.com/Examples/http-post.php", False)
$oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
; Performing the Request
$oHTTP.Send($sPD)
; Download the body response if any, and get the server status response code.
$oReceived = $oHTTP.ResponseText
$oStatusCode = $oHTTP.Status
If $oStatusCode <> 200 then
MsgBox(4096, "Response code", $oStatusCode)
EndIf
; Saves the body response regardless of the Response code
$file = FileOpen("Received.html", 2) ; The value of 2 overwrites the file if it already exists
FileWrite($file, $oReceived)
FileClose($file)
Si je viens lire le code source a la fin en faisant un :
Hallo Jacob Your best bench of 150 appears valid.
Ce n'est pas le cas pour moi
Comment voir si je suis bien loggué ?
Merci