我如何解码&解析URL,以便我可以将其用作POST参数。
continue=http%3A%2F%2Fmail.google.com%2Fmail%2F&service=mail&rm=false&dsh=..
var
URL:String;
Data:TStringList;
MemoryStream:TMemoryStream;
begin
IdHTTP1.Post(URL, Data, MemoryStream);
答案 0 :(得分:2)
您可以使用TIdURI
:
TIdURI.URLDecode(...)
。TIdURI.Create
。把它放在一起就有这样的东西:
var
URI: TIdURI;
....
URI := TIdURI.Create(TIdURI.URLDecode(EncodedURI));
try
// Protocol = URI.Protocol
// Username = URI.Username
// Password = URI.Password
// Host = URI.Host
// Port = URI.Port
// Path = URI.Path
// Query = URI.Params
finally
URI.Free;
end;
承认这些答案: