There is one java sun.Applet embeded inside a HTTPS webpage. After entering valid profile and password, I can access to that applet, request data of the Http headers captured by Fiddler when my login to that applet is showed in the image below.
what I need is the cookie set from its response text, the cookie is useful in the following actions. I tried codes below with WinHttpRequest.5.1, but I do not know how to emulate the postdata, as you can see in the image, a few characters appear as black squares. And also I tried document.cookie but failed, it returns nothing.
Dim objHTTP As Object
Dim URL As String
Dim PostData as String
Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
URL = "Https://xxxxxx"
PostData = ""
With objHTTP
.Open "POST", URL, False
.setRequestHeader "User-Agent", "Mozilla/4.5 [en] (winNT; I)"
.setRequestHeader "companyID", "CN"
.setRequestHeader "Auth_Mode", "2"
.setRequestHeader "CONTENT_TYPE", "application/octet-stream"
.setRequestHeader "Cache-Control", "no-cache"
.setRequestHeader "Pragma", "no-cache"
.setRequestHeader "Host", "XXXXX.com"
.setRequestHeader "Accept", "text/html, image/jpeg, *; q=.2, */*; q=.2"
.setRequestHeader "Proxy-Connection", "Keep-alive"
.setRequestHeader "Content-type", "application/x-www-form-urlencode"
.setRequestHeader "Content-Length", "419"
.Send PostDate
End With