source: trunk/Packages/synapse/source/demo/FreePascal/testhttp.pas

Last change on this file was 2, checked in by chronos, 12 years ago
  • Přidáno: Základní kostra projektu.
  • Přidáno: Knihovna synapse.
File size: 606 bytes
Line 
1{$MODE DELPHI}
2
3Program testhttp;
4
5uses
6 httpsend, classes;
7
8var
9 HTTP: THTTPSend;
10 l: tstringlist;
11begin
12 HTTP := THTTPSend.Create;
13 l := TStringList.create;
14 try
15 if not HTTP.HTTPMethod('GET', Paramstr(1)) then
16 begin
17 writeln('ERROR');
18 writeln(Http.Resultcode);
19 end
20 else
21 begin
22 writeln(Http.Resultcode, ' ', Http.Resultstring);
23 writeln;
24 writeln(Http.headers.text);
25 writeln;
26 l.loadfromstream(Http.Document);
27 writeln(l.text);
28 end;
29 finally
30 HTTP.Free;
31 l.free;
32 end;
33end.
34
Note: See TracBrowser for help on using the repository browser.