Christopher_J_B
Sep 22, 2010Nimbostratus
Attempting to remove newline/spaces from a HTTP:payload without sucess
I have an irule that parses http payload that contain xml using the findstr function; the problem is some vendors xml requests have spaces and/or newline characters which getting difficult to account for. I am attempting to perform a string map - replacing spaces and newline chars with empty space. I keep getting errors and I cannot seem to get to save without errors.
Here is the actual line - attempting to replace all newline & spaces with empty from the HTTP:payload - while capturing string into the variable
set tmp [findstr [string map [" " "" "\n" ""][HTTP::payload]] "<" 16 ":"]
Here are the errors for the above line
line 32: [wrong args] [string map [" " "" "\n" ""][HTTP::payload]]
line 32: [undefined procedure: ] [" " "" "\n" ""]
I tried this variation - no joy
set tmp [findstr [string map [list " " "" "\n" ""][HTTP::payload]] "<" 16 ":"]
Got this error
line 32: [wrong args] [string map [list " " "" "\n" ""][HTTP::payload]]
Any suggestions?