Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,16 @@
{$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.

View file

@ -0,0 +1,47 @@
program http;
{$mode objfpc}{$H+}
{$APPTYPE CONSOLE}
{$DEFINE DEBUG}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes, httpsend; // Synapse httpsend class
{$R *.res}
var
Response: TStrings;
HTTPObj: THTTPSend;
begin
HTTPObj := THTTPSend.Create;
try
{ Stringlist object to capture HTML returned
from URL }
Response := TStringList.Create;
try
if HTTPObj.HTTPMethod('GET','http://wiki.lazarus.freepascal.org/Synapse') then
begin
{ Load HTTP Document into Stringlist }
Response.LoadFromStream(HTTPObj.Document);
{ Write the response to the console window }
Writeln(Response.Text);
end
else
Writeln('Error retrieving data');
finally
Response.Free;
end;
finally
HTTPObj.Free;
end;
// Keep console window open
Readln;
end.