获取http-only只读cookie Autohotkey | Thinkai's Blog

Thinkai's Blog

Autohoutkey|Python|php|aardio|VOIP|IT 爱好者

获取http-only只读cookie Autohotkey 1655

作者为 发表

Autohotkey

GetCookie(){
	static url, ua ;链接,user-agent
	if !url
		url := "http://shop.xj.189.cn:8081/xjwt_webapp/RechangeController/index.do?params=Y2hhbm5lbElkPThhODI4YjQ1NGUzZjIwMTIwMTRlNDdlYjZjYWUwMDBh&fastcode=10000321"
	if !ua
		ua := "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.84 Safari/535.11 LBBROWSER"
	;设置request-header
	headers := {"Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8","Upgrade-Insecure-Requests":"1","Accept-Encoding":"gzip,deflate","Accept-Language":"zh-CN,zh;q=0.8","Host":"shop.xj.189.cn:8081","User-Agent":ua}
	hObject:=ComObjCreate("WinHttp.WinHttpRequest.5.1")
	Try
	{
		hObject.Open("GET",url) ;get/post
		for k,v in headers ;设置请求头
		    hObject.SetRequestHeader(k, v)
		hObject.Send()
		hObject.WaitForResponse(-1)
	}
	hds := hObject.GetAllResponseHeaders() ;获取所有cookie

	cookie := ""
	Loop, Parse, hds, `n, `r
	{
		if RegExMatch(A_LoopField,"Set-Cookie:([^;]*;)",m)
			cookie .= m1
	}
	return cookie
}



来了就留个评论吧! 没有评论




友情链接:Autohotkey中文论坛Autohotkey中文帮助Autohotkey官网我的B站直播间如若生涯一场梦博客联系作者免GooglePlay APK下载

 主题设计 • skyfrit.com  Thinkai's Blog | 保留所有权利

63 queries in 2.386 seconds |