Dear David,

This is just solved in the case, the query parameters consists of just one value. The command [ns_conn query] gives you the raw values of all parameters as passed to the server.

In order the get the keys, values, ... of all query parameters, get the ns_set of the decoded query parameters via [ns_conn form], and from that  you can get the list of keys, values, or whatever. See below for an example

all the best

-gn


========================================== query-parameters.tcl
ns_return 200 text/plain [subst {
    ns_conn query = '[ns_conn query]'
    ns_conn form  = '[ns_conn form]'
array = '[ns_set array [ns_conn form]]'
    keys          = '[ns_set keys [ns_conn form]]'
    values        = '[ns_set values [ns_conn form]]'
}]
==========================================



========================================== output from 
/query-parameters.tcl?x=1&y=2%203&zzzz
    ns_conn query = 'x=1&y=2%203&zzzz'
    ns_conn form  = 't7'
array = 'x 1 y {2 3} zzzz {}'
    keys          = 'x y zzzz'
    values        = '1 {2 3} {}'
==========================================

On 05.10.21 23:37, D.Fox wrote:
Sorry for the inconvenience.

[ns_conn query] is what I'm looking for!

All solved. thanks.

------------------------------------------------------------------------
*From: *"D.Fox" <uns...@crystalforest.tf>
*To: *"naviserver-devel" <naviserver-devel@lists.sourceforge.net>
*Sent: *Tuesday, October 5, 2021 10:31:54 PM
*Subject: *Capturing the URL query without the key?

Hi, I've scanned through the manual. I am aware of ns_queryget which works fine if your using key/value.

URL/?Someone=Somewhere
[ns_queryget Someone] would return "Somewhere"

However I am looking to just capture just the key.

Example:
URL/?00000000000
Capturing "00000000000"

Is this possible and if so, could someone point me in the right direction?
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to