Sample code for 30+ languages & platforms
Delphi ActiveX

Example: Http.GetUrlPath method

Demonstrates the GetUrlPath method.

Chilkat Delphi ActiveX Downloads

Delphi ActiveX
uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB;

...

procedure TForm1.Button1Click(Sender: TObject);
var
success: Integer;
http: TChilkatHttp;
url: WideString;

begin
success := 0;

http := TChilkatHttp.Create(Self);
url := 'https://example.com/folder/page?lang=en&sort=asc#section2';
Memo1.Lines.Add(http.GetUrlPath(url));

// Output:

// /folder/page
end;