unknown
2006-08-29 17:01:11 UTC
My intention is to fetch data, embedded in HTML documents, from a website
with a TIdHTTP. So, I have a form with a TIdHTTP dropped on it, and using
the GET method I can read the HTML documents into a string for further
processing. And so far all is OK.
The next step is to be able to read some files that requires that I am
logged in. The login page has the Username and Password fields as expected
and they are submitted to the server with the POST method over a HTTPS
connection. The server returns two cookies that then are used as
authorisation for the rest of the session over normal HTTP connection. This
I found out with the help of a sniffer demo (which unfortunately expired
and I cant use anymore).
Now I suppose that I could simulate a browser with the TIdHTTP using the SSL
libraries (which I already downloaded for the purpose) to be able to get
hold of the cookies, but before I go down that route I would like to ask
your opinions if the following would be possible:
Can I use a TWebBrowser for the actual logging in and then somehow fetch the
cookies from the TWebBrowser to continue using them with the TIdHTTP and
TIdCookieManager? Looking at the properties and methods of the TWebBrowser I
could not identify anything as related to the cookies, but maybe there is a
way. Btw, the cookies are not stored on disk, probably because they don't
have an expiry date.
I'm using D2005 and Indy 10.0.20. Reading other messages on this board I
know its an old version, but I would not right now like to go through the
upgrading procedure, if possible.
Best regards
with a TIdHTTP. So, I have a form with a TIdHTTP dropped on it, and using
the GET method I can read the HTML documents into a string for further
processing. And so far all is OK.
The next step is to be able to read some files that requires that I am
logged in. The login page has the Username and Password fields as expected
and they are submitted to the server with the POST method over a HTTPS
connection. The server returns two cookies that then are used as
authorisation for the rest of the session over normal HTTP connection. This
I found out with the help of a sniffer demo (which unfortunately expired
and I cant use anymore).
Now I suppose that I could simulate a browser with the TIdHTTP using the SSL
libraries (which I already downloaded for the purpose) to be able to get
hold of the cookies, but before I go down that route I would like to ask
your opinions if the following would be possible:
Can I use a TWebBrowser for the actual logging in and then somehow fetch the
cookies from the TWebBrowser to continue using them with the TIdHTTP and
TIdCookieManager? Looking at the properties and methods of the TWebBrowser I
could not identify anything as related to the cookies, but maybe there is a
way. Btw, the cookies are not stored on disk, probably because they don't
have an expiry date.
I'm using D2005 and Indy 10.0.20. Reading other messages on this board I
know its an old version, but I would not right now like to go through the
upgrading procedure, if possible.
Best regards