RESTXQ: Handling Lots of Parameters?
Sunday, 7 August 2022 · 3 messages
EK
Eliot Kimber7 Aug 2022 22:00 #
I’m making a RESTXQ page that handles a form where the form can have a number of different parameters.
I’m not seeing a way to define a RESTXQ handler that can handle an arbitrary number of parameters of different names, i.e., if my URL is:
https://example.com/form-handler?foo=1&bar=2&fred=3&baz=4
Is there a way to define a RESTXQ handling function that doesn’t have to enumerate each of these parameters in its function declaration?
This is mostly looking for a convenience for not having to update a function declaration every time I add a field to a form that is constructed elsewhere and added to the page or maybe a dynamically-constructed form.
Thanks,
E.
_____________________________________________
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368
servicenow.com<https://www.servicenow.com>
LinkedIn<https://www.linkedin.com/company/servicenow> | Twitter<https://twitter.com/servicenow> | YouTube<https://www.youtube.com/user/servicenowinc> | Facebook<https://www.facebook.com/servicenow>
IL
Imsieke, Gerrit, le-tex7 Aug 2022 22:15 #
Quoted text · Eliot Kimber · 21 lines
On 07.08.2022 22:00, Eliot Kimber wrote: > I’m making a RESTXQ page that handles a form where the form can have a > number of different parameters. > > I’m not seeing a way to define a RESTXQ handler that can handle an > arbitrary number of parameters of different names, i.e., if my URL is: > > https://example.com/form-handler?foo=1&bar=2&fred=3&baz=4 > <https://example.com/form-handler?foo=1&bar=2&fred=3&baz=4> > > Is there a way to define a RESTXQ handling function that doesn’t have to > enumerate each of these parameters in its function declaration? > > This is mostly looking for a convenience for not having to update a > function declaration every time I add a field to a form that is > constructed elsewhere and added to the page or maybe a > dynamically-constructed form. > > Thanks, > > E.
EK
Eliot Kimber7 Aug 2022 23:02 #
Of course—I should have thought to inspect the request.
Thanks!
Cheers,
E.
_____________________________________________
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368
servicenow.com<https://www.servicenow.com>
LinkedIn<https://www.linkedin.com/company/servicenow> | Twitter<https://twitter.com/servicenow> | YouTube<https://www.youtube.com/user/servicenowinc> | Facebook<https://www.facebook.com/servicenow>
Quoted text · BaseX-Talk · 27 lines
From: BaseX-Talk <basex-talk-bounces at mailman.uni-konstanz.de> on behalf of Imsieke, Gerrit, le-tex <gerrit.imsieke at le-tex.de> Date: Sunday, August 7, 2022 at 3:15 PM To: basex-talk at mailman.uni-konstanz.de <basex-talk at mailman.uni-konstanz.de> Subject: Re: [basex-talk] RESTXQ: Handling Lots of Parameters? [External Email] https://urldefense.com/v3/__https://docs.basex.org/wiki/Request_Module*request:parameter-names__;Iw!!N4vogdjhuJM!AqGYM-xUAKVaqTr3Cl5t3jdYDjzcortocniS72Z6AoclolwjBA5BS-mU9IA8G4giL7zLv8Uo09YzoTAE0q5eORVqKz5sHVKEgA$<https://urldefense.com/v3/__https:/docs.basex.org/wiki/Request_Module*request:parameter-names__;Iw!!N4vogdjhuJM!AqGYM-xUAKVaqTr3Cl5t3jdYDjzcortocniS72Z6AoclolwjBA5BS-mU9IA8G4giL7zLv8Uo09YzoTAE0q5eORVqKz5sHVKEgA$> On 07.08.2022 22:00, Eliot Kimber wrote: > I’m making a RESTXQ page that handles a form where the form can have a > number of different parameters. > > I’m not seeing a way to define a RESTXQ handler that can handle an > arbitrary number of parameters of different names, i.e., if my URL is: > > https://urldefense.com/v3/__https://example.com/form-handler?foo=1&bar=2&fred=3&baz=4__;!!N4vogdjhuJM!AqGYM-xUAKVaqTr3Cl5t3jdYDjzcortocniS72Z6AoclolwjBA5BS-mU9IA8G4giL7zLv8Uo09YzoTAE0q5eORVqKz7LXT5jiw$<https://urldefense.com/v3/__https:/example.com/form-handler?foo=1&bar=2&fred=3&baz=4__;!!N4vogdjhuJM!AqGYM-xUAKVaqTr3Cl5t3jdYDjzcortocniS72Z6AoclolwjBA5BS-mU9IA8G4giL7zLv8Uo09YzoTAE0q5eORVqKz7LXT5jiw$> > <https://urldefense.com/v3/__https://example.com/form-handler?foo=1&bar=2&fred=3&baz=4__;!!N4vogdjhuJM!AqGYM-xUAKVaqTr3Cl5t3jdYDjzcortocniS72Z6AoclolwjBA5BS-mU9IA8G4giL7zLv8Uo09YzoTAE0q5eORVqKz7LXT5jiw$ > > > Is there a way to define a RESTXQ handling function that doesn’t have to > enumerate each of these parameters in its function declaration? > > This is mostly looking for a convenience for not having to update a > function declaration every time I add a field to a form that is > constructed elsewhere and added to the page or maybe a > dynamically-constructed form. > > Thanks, > > E.
Written for BaseX 10.0. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery