Forum Discussion
Kevin_Stewart
Aug 02, 2013Employee
At a minimum you probably want to use the HTTP::collect command and HTTP_REQUEST_DATA event to capture the payload:
when HTTP_REQUEST {
if { ( [HTTP::method] equals "POST" ) and ( [string tolower [HTTP::uri]] contains "keepal" ) } {
HTTP::collect [HTTP::header Content-Length]
}
}
when HTTP_REQUEST_DATA {
set payload [HTTP::payload]
All collected payload is available here...
}
You're most likely not seeing the payload in the HTTP_REQUEST event because it exceeds a single TCP packet. Using HTTP::collect tells the iRule to collect and buffer the payload (up to the specified amount) and make it available in the HTTP_REQUEST_DATA event. Take a look at the wiki for both of these (command and event) for more thorough implementations.