![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Как достать запрашиваемый URL из GET (http) ?
Makhanev Alexander © (2007-06-18 14:52:00)у меня есть вся команда GET,
требуется получить запрашиваемый браузером URL.
я так понял, что надо совместить то что лежит в HOST с тем что указано в GET.
свой парсер написать не проблема, но вдруг я упущу какие-то случаи...
поэтому, буду рад, если кто даст линк\код готового парсера http команды get который мне вернет url.
Орион (2007-06-18 15:16:00) [1]
TDemiurgeCommandParser = class
private
FText,
FURI,
FProtoVersion,
FCommand: string;
function GetText: string;
procedure SetText(const Value: string);
public
constructor Create(ACommandText: string);
property Command: string read FCommand write FCommand;
property URI: string read FURI write FURI;
property ProtoVersion: string read FProtoVersion write FProtoVersion;
property Text: string read GetText write SetText;
end;
{ TDemiurgeCommandParser }
constructor TDemiurgeCommandParser.Create(ACommandText: string);
begin
inherited Create;
Text:=ACommandText;
end;
function TDemiurgeCommandParser.GetText: string;
begin
Result:=FCommand+' '+FURI+' '+FProtoVersion;
end;
procedure TDemiurgeCommandParser.SetText(const Value: string);
var
CommandText: string;
function Extract(var AText: string): string;
begin
Result:=Fetch(AText, ' ');
AText:=TrimLeft(AText);
end;
begin
FText:=Value;
CommandText:=Value;
FCommand:=Extract(CommandText);
FURI:=Extract(CommandText);
FProtoVersion:=CommandText;
end;