Difference between revisions of "fphttpclient"

From Free Pascal wiki
Jump to navigationJump to search
(Created page, more of a placeholder still...)
 
m
Line 1: Line 1:
fphttpclient is supplied with FPC.
+
fphttpclient is supplied with FPC as part of the [[fcl-web]] package, and can be used by itself as well.
  
 
== Examples ==
 
== Examples ==

Revision as of 12:56, 24 November 2012

fphttpclient is supplied with FPC as part of the fcl-web package, and can be used by itself as well.

Examples

Get body of an HTTP page

uses fphttpclient;

Var
  S : String;

begin
  With TFPHttpClient.Create(Nil) do
    try
      S:=Get(ParamStr(1));
  finally
    Free;
  end;
  Writeln('Got : ',S);
end.

If you want to write even less lines of code, in FPC 2.7.1 you can use the class method:

s := TFPCustomHTTPClient.SimpleGet('http://a_site/a_page');