Jump to content
Sign in to follow this  
Vĩ Kha Blog

Send request with cookie

Recommended Posts

I'm logged into the site http://me.zing.vn

After login, I get cookie of the site. But when I request to visit homepage and read source of the site

If I add cookie then it display : http://www.upsieutoc.com/images/2015/11/19/untitled.jpg

And when I don't add cookie then It display the source of the site when not logged in

Func scookie()
   Local $o = _WinHttpOpen("")
    Local $hConnect = _WinHttpConnect($o, "http://me.zing.vn/u/vikhablog")
    Local $hRequest = _WinHttpOpenRequest($hConnect, Default,"vi-VN,vi;q=0.8,en-US;q=0.5,en;q=0.3")
    _Winhttpaddrequestheaders($hRequest,"User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:42.0) Gecko/20100101 Firefox/42.0")
    _Winhttpaddrequestheaders($hRequest,"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
    _Winhttpaddrequestheaders($hRequest,"Accept-Language: vi-VN,vi;q=0.8,en-US;q=0.5,en;q=0.3")
    _Winhttpaddrequestheaders($hRequest,"Accept-Encoding: deflate")
    _Winhttpaddrequestheaders($hRequest,"Connection: keep-alive")
    _WinHttpAddRequestHeaders($hRequest, "Cookie: " & $Cookie)
   Local $s = Decode(_winhttpreaddata($hRequest))




Who can help me, please !



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  

  • Create New...