12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- {
- $Id$
- This file is part of the Free Pascal run time library.
- Copyright (c) 2003 by the Free Pascal development team
- Test uriparser unit
-
- See the file COPYING.FPC, included in this distribution,
- for details about the copyright.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- **********************************************************************}
- {$MODE objfpc}
- {$H+}
- program Testuri;
- uses URIParser;
- var
- URI: TURI;
- s: String;
- begin
- with URI do
- begin
- Protocol := 'http';
- Username := 'user';
- Password := 'pass';
- Host := 'localhost';
- Port := 8080;
- Path := '/test/dir';
- Document := 'some index.html';
- Params := 'param1=value1¶m2=value2';
- Bookmark := 'bookmark';
- end;
- s := EncodeURI(URI);
- WriteLn(s);
- FillChar(URI, SizeOf(URI), #0);
- URI := ParseURI(s, 'defaultprotocol', 1234);
- with URI do
- begin
- WriteLn('Protocol: ', Protocol);
- WriteLn('Username: ', Username);
- WriteLn('Password: ', Password);
- WriteLn('Host: ', Host);
- WriteLn('Port: ', Port);
- WriteLn('Path: ', Path);
- WriteLn('Document: ', Document);
- WriteLn('Params: ', Params);
- WriteLn('Bookmark: ', Bookmark);
- end;
- end.
- {
- $Log$
- Revision 1.1 2003-05-17 20:54:03 michael
- + uriparser unit added. Header/Footer blocks added
- }
|