> Can I access an http web page from Delphi,
> then "click" the submit
> button in code and read the response page?

You can do that by using any good HTTP client component.
There are a few on the market and at least two good which are free: Indy and 
ICS.
ICS is freeware with full source code. It is included by Borland on Delphi 
7,8,2005 and 2006 partner
CD/DVD. You can download also from http://www.overbyte.be. See HttpTst demo 
included with ICS.

Shortly, using the HTTP client component, you specify an URL and call one of 
the HTTP methods such
as GET or POST. Then the component grab the answer from the server and present 
it to you. You can
then examine it and issue more requests. Along with a HTML rendiring component 
and a scripting
engine, a HTTP client component is the base of any internet browser application.

Sending data to a webserver is not more complex: basically you format a stream 
(TFileStream,
TMemoryStream or any other) with the data in the format the webserver expect 
(url-encoded, form
data, mime,...) and issue a POST method for the given "action" URL. You don't 
even need to "get" the
form page if you know what data fields, which action and which encoding there 
is.

Also, don't forget the cookies: frequently you have to get some page or to post 
some data (login
form) just to receive a cookie from the server. Then you must provide the 
cookie value for each
subsequent request. The cookie is somewhat your authentication token.

Some pages are protected by usercode/password. ICS HTTP client will handle that 
for you using "basic
authentication" or "NTLM authentication". Just feed the properties with the 
require values.

Some pages are "relocated". That is the server reply something like "sorry, the 
page you requested
is there". ICS HTTP component will take care of that for you.

Finally, at some places, network access is going thru a proxy or firewall. The 
ICS HTTP client
component will also handle that for you if you specify the proxy parameters 
(type, port, address,
credentilas,...).

--
Contribute to the SSL Effort. Visit
http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be



_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to