如何解码和解析 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);
您可以通过以下方式完成所有操作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;
确认这些答案: