June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -1,47 +0,0 @@
|
|||
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.
|
||||
Loading…
Add table
Add a link
Reference in a new issue