Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-08

Access site from app with login and password using http

7 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Osvaldo Filho

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?

Osvaldo Filho
to Robert Wolfe

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. On Aug 28, 2013 3:07 PM, "Osvaldo Filho" wrote: > 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? > > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Michael Schnell
to Osvaldo Filho: Is there any example to access information on web site that requires authentication with…
Osvaldo Filho wrote
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?

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

Osvaldo Filho
to Michael Schnell

Could you send a piece of code as an example?

2013/8/29 Michael Schnell

Show quoted text 25 lines
On 08/28/2013 10:07 PM, Osvaldo Filho wrote: > 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? > 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 ______________________________**_________________ fpc-pascal maillist - http://lists.freepascal.org/**mailman/listinfo/fpc-pascal<http://lists.freepascal.org/mailman/listinfo/fpc-pascal>
Benito van der Zander
to Osvaldo Filho: 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

Osvaldo Filho wrote 8 lines
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? _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal