After the request is sent, will receive contains a set of Cookie header, the Cookie I need received to the back of the operation,
But is unlikely to simulate this request, tried to use the document. The cookie, returns an empty result,
Please the teacher give directions
I use the following code, but really don't know how to write a post data that a
Dim objHTTP As Object
Dim the URL As a String
Dim PostData as String
Set objHTTP=CreateObject (" WinHttp WinHttpRequest. 5.1 ")
URL="Https://xxxxxx"
PostDatahttps://bbs.csdn.net/topics/=""
With objHTTP
. Open the "POST", URL, False
The user-agent. SetRequestHeader ", "" 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, */*; 2 "
q=.. SetRequestHeader "Proxy - Connection", "Keep alive -
"The content-type. SetRequestHeader ", "" application/x - WWW - form - urlencode"
"SetRequestHeader Content - Length", "419"
. Send PostDate
End With
CodePudding user response:
Looks like a materialization of JAVA classes, and is probably the most special customized login process,Certainly not directly using the browser login?
CodePudding user response:
I'm sorry, didn't look at your text,I have provided a train of thought, add a browser controls in your application, see if you can direct call this login applet, normal to complete the login process,
A Windows exe instance, can be regarded as a domain, in this domain, a cookie is automatically in the next post data with,
I speak an instance to see for you to have inspired,
All a company's current application certification is in the form of web single sign-on (sso), there is a very old application, the client is vb6 compilation, by accessing middleware server running on the Java interface to complete the business operations, now need to modernise application of the single sign-on mechanism,
Eventually transformed the old login window, joined a browser control, use the controls access to the single sign-on url, and capture the new url in browser url jump events to determine whether the login is successful, after login successfully, all communications via post or get MSXML components, this time before the cookie is automatically on each post or get into the, at this time, and then open another exe instance, you need another login, and into another cookie,
Now, a good run this application, and can solve the problem of account maintenance staff, also accord with the company's information security regulation,