Forum Discussion

3 Replies

  • As long as those are path and not query values and always in the same location as your example the following will get the data values from within the path:

    set valueA [getfield [getfield [HTTP::path] "/" 3] "=" 2]
    set valueB [getfield [getfield [HTTP::path] "/" 4] "=" 2]
    
  • Hi,

    2 solutions for you:

    First solution:

    set uri [HTTP::uri]
    regexp {^.*valueA=([^\/]+)\/valueB=(.*)$} $uri -> valuea valueb
    

    Second solution:

    set uri [HTTP::uri]
    
    set valuea [findstr $uri /valueA= 8 /]
    set valueb [findstr $uri /valueB= 8 end]
    

    Hope it will help you. keep me in touch.

    regards,

  • Hi,

    you can use scan command, faster than regexp...

    scan [HTTP::uri] {/%[^/]/valueA=%[^/]/valueB=%[^/]} garbage valueA valueB