Forum Discussion
kai_wang_48807
Nimbostratus
Feb 02, 2007uri query usage
Please help check the following usage
When CLIENT uri is like http://123.com/123=?456=sss&ABC=123&SSS
The BIGIP prompt the following iRule is wrong:
set query [URI::query [HTTP::uri] "ABC"]
log local0. "msisdn is $query"
set path [URI::path [HTTP::uri] "ABC" "&"]
log local0. "Path of uri [HTTP::uri] is $path"
Please give some suggestion
- I'm not sure exactly what your question is so I'll just analyze your iRule and hopefully that will give you the answers you need.
set path [URI::path [HTTP::uri] 2 2]
when HTTP_REQUEST { log local0. "----------------------" log local0. "URI Information" log local0. "----------------------" log local0. "HTTP::uri: [HTTP::uri]" log local0. "----------------------" log local0. "Path Information" log local0. "----------------------" log local0. "HTTP::path: [HTTP::path]" set depth [URI::path [HTTP::uri] depth] for {set i 1} {$i <= $depth} {incr i} { set dir [URI::path [HTTP::uri] $i $i] log local0. "dir\[$i\]: $dir" } log local0. "Basename: [URI::basename [HTTP::uri]]" log local0. "----------------------" log local0. "Query Information" log local0. "----------------------" log local0. "HTTP::query: [HTTP::query]" set namevals [split [HTTP::query] "&"] for {set i 0} {$i < [llength $namevals]} {incr i} { set params [split [lindex $namevals $i] "="] set pnum [expr $i+1] log local0. "Param\[$pnum\]: [lindex $params 0]" Commented out to show how to use URI::query in the next line. Both lines produce the same output. log local0. "Value\[$pnum\]: [lindex $params 1]" log local0. "Value\[$pnum\]: [URI::query [HTTP::uri] [lindex $params 0]]" } }
- kai_wang_48807
Nimbostratus
Hi, Joe
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects