Forum Discussion
matm_58717
Nimbostratus
Jul 11, 2013modify Request POST
Hello,
I have a web application where introduce user credential. When a client introduces your credentials, need intercept and inspect the POST, looking for the value to field "username".
I...
Kevin_Stewart
Employee
Jul 11, 2013The username, I'm guessing, is in the POST payload. Example:
username=foo&password=bar
So something like this might work to extract the username from that data:
when HTTP_REQUEST {
if { [HTTP::method] equals "POST" } {
HTTP::collect [HTTP::header Content-Length]
}
}
when HTTP_REQUEST_DATA {
if { [HTTP::payload] contains "username=" } {
foreach x [split [HTTP::payload] "&"] {
if { $x starts_with "username=" } {
set username [lindex [split $x "="] 1]
}
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects