Frederick Posted December 8, 2021 Share Posted December 8, 2021 I have a URL like https://www.mydomain.com/?name=James+Tan&phone=0131234123 How do I get the parameter list as-is like the following? ?name=James+Tan&phone=0131234123 -- Frederick (UniGUI Complete - Professional Edition 1.90.0.1555) Quote Link to comment Share on other sites More sharing options...
Marlon Nardi Posted December 8, 2021 Share Posted December 8, 2021 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; 1 Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted December 8, 2021 Share Posted December 8, 2021 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 Quote Link to comment Share on other sites More sharing options...
Frederick Posted December 8, 2021 Author Share Posted December 8, 2021 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? Quote Link to comment Share on other sites More sharing options...
x11 Posted December 8, 2021 Share Posted December 8, 2021 http://www.unigui.com/doc/online_help/api/uniGUIApplication_TUniGUIApplication_Parameters.html before login http://forums.unigui.com/index.php?/topic/10100-skip-login-form-if-url-parameters-were-passed/&tab=comments#comment-52586http://forums.unigui.com/index.php?/topic/8873-how-to-pass-parameters-with-link-http/&tab=comments#comment-45656 http://forums.unigui.com/index.php?/topic/3157-url-with-parameters/&tab=comments#comment-14639 http://forums.unigui.com/index.php?/topic/9959-url-params-bug-mobile/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.