Task

Access and print a URL's content (the located resource) to the console.

There is a separate task for HTTPS Requests.




{$mode objfpc}{$H+}
uses fphttpclient;
 
var
  s: string;
  hc: tfphttpclient;
 
begin
  hc := tfphttpclient.create(nil);
  try
    s := hc.get('http://www.example.com')
  finally
    hc.free
  end;
  writeln(s)
end.