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 |
|
---|
3 | Program testhttp;
|
---|
4 |
|
---|
5 | uses
|
---|
6 | httpsend, classes;
|
---|
7 |
|
---|
8 | var
|
---|
9 | HTTP: THTTPSend;
|
---|
10 | l: tstringlist;
|
---|
11 | begin
|
---|
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;
|
---|
33 | end.
|
---|
34 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.