Forum Discussion

4 Replies

  • 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"
    }
    
  • 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]]
        }
    }
    
  • 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.

     

  • 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