Jump to content

How To Get URL Parameters As-Is?


Frederick

Recommended Posts

There are several ways, the simplest I use is the following:

in ServerModule -> OnHTTPCommand

Sample:

procedure TUniServerModule.UniGUIServerModuleHTTPCommand(
  ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo;
  var Handled: Boolean);
var
  vParams: string;
  vI: Integer;
begin
    for vI := 0 to ARequestInfo.Params.Count - 1 do
    begin
        if vI = 0 then
        vParams := '?' + ARequestInfo.Params[vI]
        else
        vParams := vParams + '&' + ARequestInfo.Params[vI]
    end;
end;

 

  • Like 1
Link to comment
Share on other sites

1 hour ago, Marlon Nardi said:

There are several ways, the simplest I use is the following:

in ServerModule -> OnHTTPCommand

Sample:

procedure TUniServerModule.UniGUIServerModuleHTTPCommand(
  ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo;
  var Handled: Boolean);
var
  vParams: string;
  vI: Integer;
begin
    for vI := 0 to ARequestInfo.Params.Count - 1 do
    begin
        if vI = 0 then
        vParams := '?' + ARequestInfo.Params[vI]
        else
        vParams := vParams + '&' + ARequestInfo.Params[vI]
    end;
end;

 

Thx Marlon

Link to comment
Share on other sites

1 hour ago, Marlon Nardi said:

There are several ways, the simplest I use is the following:

in ServerModule -> OnHTTPCommand

Sample:

procedure TUniServerModule.UniGUIServerModuleHTTPCommand(
  ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo;
  var Handled: Boolean);
var
  vParams: string;
  vI: Integer;
begin
    for vI := 0 to ARequestInfo.Params.Count - 1 do
    begin
        if vI = 0 then
        vParams := '?' + ARequestInfo.Params[vI]
        else
        vParams := vParams + '&' + ARequestInfo.Params[vI]
    end;
end;

 

If I am not mistaken, ServerModule is a singleton. How do I get the parameter text for different sessions from the MainForm?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...