Is there any example to access information on web site that requires authentication with login and password in form using http from a Lazarus application?
Mailing lists / fpc-pascal / 2013-08
Access site from app with login and password using http
7 messages · 5 people · –
- OOsvaldo Filho 3
- BBenito van der Zander 1
- MMichael Schnell 1
- RRobert Wolfe 1
- SSven Barth 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Probably, but only if the lazarus application is built as a CGI.
"Osvaldo Filho" wrote 8 lines
Ok, yes, on cgi app.
Where?
2013/8/28 Robert Wolfe
Show quoted text 16 lines
Probably, but only if the lazarus application is built as a CGI.
"Robert Wolfe" wroteProbably, but only if the lazarus application is built as a CGI.
Ehm. I think he means accessing an existing webpage which has login with a Lazarus application and not letting a Lazarus application provide a webbased login...
Regards,
Sven
Is there any example to access information on web site that requires authentication with…
Osvaldo Filho wroteIs there any example to access information on web site that requires authentication with login and password in form using http from a Lazarus application?
I used Synapse to access the web site of an embedded controller.
Using FireFox with a "developer" plugin, I analyzed the data exchange between browser and server. (In fact here a cookie was involved, supposedly to allow the server to do an automatic log out after some idle time.)
After that I recreated the dialog in pascal code with Synapse HTTP functions.
I suppose the details of the necessary actions to a successful login might very between different sites.
-Michael
Could you send a piece of code as an example?
2013/8/29 Michael Schnell
Show quoted text 25 lines
Is there any example to access information on web site that requires authentication with…
My Internet Tools (http://www.benibela.de/sources_en.html#internettools) are made for that.
For example:
uses simpleinternet;
var i: IXQValue;
begin
for i in
process(httpRequest(process('http://www.example.org/the/page/with/the/login/form',
'form(/form, {"username": "'+username+'", "password": "'+password+'"})')),
'//tr/td[2]') do
writeln(i.toString);
end.will fill out the login form on the first page, then load the second page, and print the values of the second column of all table rows
