Jump to content

Get info page HTTPS from winhttp

Recommended Posts

Hi Gui

I get a page https. I use winhttps. Response just blank page.

My code is. Anyone help


#include <String.au3>
#include <MsgBoxConstants.au3>
#include <ZLIB.au3>

$hOpen = _WinHttpOpen()
$hConnect1 = _WinHttpConnect($hOpen,"https://muaban.net")
Local $post = ""
Local $hRequest1
$hRequest1 = _WinHttpOpenRequest($hConnect1,"GET","/","",'','',$WINHTTP_FLAG_SECURE)
_WinHttpAddRequestHeaders($hRequest1, "Host: muaban.net")
_WinHttpAddRequestHeaders($hRequest1, "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:44.0) Gecko/20100101 Firefox/44.0")
_WinHttpAddRequestHeaders($hRequest1, "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
_WinHttpAddRequestHeaders($hRequest1, "Accept-Language: en-US,en;q=0.5")
_WinHttpAddRequestHeaders($hRequest1, "Connection: keep-alive")
_WinHttpSendRequest($hRequest1, -1, $post)
If (_WinHttpReceiveResponse($hRequest1)==1) Then
    Local $Header = _WinHttpQueryHeaders($hRequest1)
    Local $Data = _WinHttpSimpleReadData($hRequest1, 2)
    $cookie = _StringBetween($Header,"Set-Cookie: ",";")
    $data1 = BinaryToString(_ZLIB_GZUncompress($Data),4)
    $ls = StringRegExp($data1,'<meta content="(.+?)" name="csrf-token" />',3)



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

  • Recently Browsing   0 members

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