How can I decode & parse a URL so I can use it as POST parameters.
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);
You can do it all with TIdURI
:
TIdURI.URLDecode(...)
.TIdURI.Create
.Putting it together you'd have something like this:
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;
With acknowledgement to these answers: