How To Download A File In A Password-protected Location In Delphi 2007
I need to get the contents of a HTML page from the Web, but the contents of the respective resource is only available after the user has logged into the website. To be more specif
Solution 1:
THTTPSend has a property .Cookies (TStringList) which takes name-value pairs (each one being a cookie). If you use the same THTTPSend instance to post through the login procedure then the cookies sent from YouTube will be captured and will be retained in future requests using the same THTTPSend instance. You can either do this each time (getting a new cookie) or you can hard (or soft) code the cookie information into the THTTPSend before making the request to the protected page.
You can also just do the login once and save the .cookies TStringList somewhere, each time assigning it to any new THTTPSend you create to make new requests.
Post a Comment for "How To Download A File In A Password-protected Location In Delphi 2007"