Silvia_84906
May 04, 2010Nimbostratus
Remove a parameter from a query
Hi all,
I'm trying to remove a parameter from a query and I've tried to do it in so many ways but they didn't work as I expected...
For example the URL could be:
And I'd like to eliminate this parameter "X-PROVE-3GPDPContext=yes" from the query without removing the others.
I've tried it using the "remove" command for HTTP:query and HTTP:uri.
[HTTP::query] remove "X-VODAFONE-3GPDPContext="
Also splitting the URI like this:
if {($queryM contains "X-PROVE-3GPDPContext")}{
Split the query into name-value pairs delimited by "&"
set namevals [split [HTTP::query] "&"]
A TCL for loop - if you ever wondered what one looks like...
for {set i 0} {$i < [llength $namevals]} {incr i} {
if { $::debug>=1 } { log local0. " i: $i" }
Split name-value pair into name and value delimited by "="
set params [split [lindex $namevals $i] "="]
if { $::debug>=1 } { log local0. " parameters: $param" }
set name [lindex $params 0]
if { $::debug>=1 } { log local0. " nam : $name" }
set val [lindex $params 1]
if { $::debug>=1 } { log local0. " value : $val" }
}
But I am not able to do it in a right way.
Could you help me??
Thank you in advance!
Silvia