Forum Discussion
How do I change query param name inside the HTTP::query object in my iRule?
How do I change query param name inside the HTTP::query object in my iRule?
4 Replies
- Cory_50405
Noctilucent
If you just want to statically set HTTP::query as some arbitrary value, you can use something like this:
when HTTP_REQUEST { HTTP::query "somethinglikethis" } - Kevin_Stewart
Employee
If I may add, you can extend that to test for specific param names. Example:
when HTTP_REQUEST { if { [string tolower [HTTP::query]] contains "qc=" } { HTTP::query "qd=[URI::query ?[HTTP::query] qc]" } }You could also change it with a string map:
when HTTP_REQUEST { if { string tolower [HTTP::query]] contains "qc=" } { HTTP::query [string map -nocase {"qc=" "qd="} [HTTP::query]] } } - ssdigitalglobe_
Nimbostratus
Thanks everyone!
I tried the suggestions, and somehow I feel that the HTTP::query is read only, unable to modify it. What worked though is resetting the HTTP::uri object as -
HTTP::uri "[HTTP::path]?$query"
, where variable query holds modified HTTP:query string.
- nitass
Employee
I feel that the HTTP::query is read only, unable to modify it.
the write functionality is introduced in 11.5.0. :)
ID385615 - RFE: Make HTTP::query iRule command support writing data
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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