Good day.
I would be very grateful if somebody would help me to understand how can I login to the site "https://www.asos.com" using library WinHTTP.
I've tried like this (but there is no response):
#include "WinHttp.au3"
Local $sDomain = 'www.asos.com'
Local $sPage = 'pgecustlogin.aspx'
Local $sLogin = 'login'
Local $sPassword = 'password'
Local $hOpen = _WinHttpOpen()
Local $hConnect = _WinHttpConnect($hOpen, $sDomain, $INTERNET_DEFAULT_HTTPS_PORT)
Local $sResponse = _WinHttpSimpleFormFill($hConnect, _
$sPage, _
'EmailAddress', $sLogin, _ ; <input id="EmailAddress" />
'Password', $sPassword) ; <input id="Password" />
ConsoleWrite('! Response > ' & $sResponse & @LF)
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)
In this version I get html-text and headers, but I don't know what to do with it.
#include "WinHttp.au3"
Local $sDomain = 'www.asos.com'
Local $sPage = 'pgecustlogin.aspx'
Local $sLogin = 'login'
Local $sPassword = 'password'
Local $hOpen = _WinHttpOpen()
Local $hConnect = _WinHttpConnect($hOpen, $sDomain)
Local $hRequest = _WinHttpOpenRequest($hConnect, 'GET', $sPage, 'HTTP/1.1', $WINHTTP_NO_REFERER, $WINHTTP_DEFAULT_ACCEPT_TYPES, $WINHTTP_FLAG_SECURE)
_WinHttpSendRequest($hRequest)
_WinHttpReceiveResponse($hRequest)
Local $sHeaders = _WinHttpQueryHeaders($hRequest)
Local $sData = '', $sChunk
If _WinHttpQueryDataAvailable($hRequest) Then
While 1
$sChunk = _WinHttpReadData($hRequest, 1)
If Not @extended Then ExitLoop
$sData &= $sChunk
WEnd
EndIf
ConsoleWrite('! Headers > ' & @LF & $sHeaders & @LF)
ConsoleWrite('! Response > ' & $sData & @LF)
_WinHttpCloseHandle($hRequest)
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)
Help me please!
And thanks in advance!