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:

  1. Keep the session cookies
  2. Download the file
and enter the username and password.

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

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -