[fpc-pascal] A simple HTTP request with FPC standard units
Michael Van Canneyt
michael at freepascal.org
Fri Nov 23 17:15:36 CET 2012
On Fri, 23 Nov 2012, luciano de souza wrote:
> Hello listers,
> Using Synapse, the developer has very good features to deal with the
> HTTP protocol. But imagine you want only to do a "get" in a URL and
> take a string back. I imagine it can be done with the standard units
> of Freepascal. Is it true? How could I do it with FPC 2.7.1?
S : String;
With TFPHttpClient.Create(Nil) do
Writeln('Got : ',S);
home: >fpc -S2 th.pp
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
home: >th http://www.freepascal.org/
Got : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Web Page Design by James Koster - http://www.jameskoster.co.uk and Marko Mihel?i? - http://www.mcville.net-->
I cut off the rest.
More information about the fpc-pascal