cookies - Delphi : application to download the files using the authentication -
I want to create a device to download files from the website in the following order:
- Keep the session cookies
- Download the file
So far, to work up, I use 'wget' with the script:
wget --user-agent = "Mozilla 5.0 (Windows NT 5.2; Rv: 2.0.1) Gecko / 20100101 Firefox / 4.0.1 "--post-data =" users Class Name =% ID% and p =% password% & sublogin = login "--save-cookies =" deactivated \ cookies.txt "- How do I do with Delphi?
Class = "post-text" itemprop = "text"> For this indy TIdHTTP
component can be used:
IdHTTP1.Request.UserAgent: = 'Mozilla / 5.0 (windows NT 5.2; RV: 2.0.1) Gecho / 20100101 Firefox / 4.0.1 '; PostData: TStringList.Create; Try PostData.Add ('username' = '+ username'); PostData.Add ('password =' + password); PostData.Add ('sublogin = login'); IdHTTP1.Post ('http: //' + app + '/ login / login / logging_simple', postdata); Finally postdata. free; End;
Comments
Post a Comment