Forum Discussion
Kapil_Sharma_61
Nimbostratus
Oct 24, 2005HTTP post fields
Hi,
Is there any way to get the HTTP POST hidden fields using irules and then send the information to the backend servers?
Thanks,
kapil
3 Replies
- bl0ndie_127134Historic F5 AccountWe have been talking about adding a feature to make POST field extraction a little bit easier but for now you will have to do an HTTP::collect and use the HTTP::payload command to access and parse the data.
- Kapil_Sharma_61
Nimbostratus
Thanks for your reply. Let me explain our existing rules and what I am trying to achieve:
Existing rules:
-------------------------
when HTTP_REQUEST {
if { [active_members servpool1] == 1 } {
log "pool1 is up"
set uri [HTTP::uri]
log "the initial http uri is: $uri"
if { $uri starts_with "/logon\.mic" } {
set new_uri [string replace $uri 0 10 /mic/SignIn.mic]
HTTP::uri "$new_uri"
pool servpool1
log "The replaced URL is: $new_uri"
}
elseif { $uri starts_with "/ea/" } {
set new_uri [string range $uri 3 end]
log "the new URI is: $new_uri"
HTTP::uri "$new_uri"
pool servpool1
log "the new HTTPURI is $new_uri"
}
}
This is what we want to achieve:
1: We want to retrive a post field named "data" from the initial request from the client
2: then set the new_uri variable to :
set new_uri [string replace $uri 0 10 /mic/SignIn.mic?data=$data]
where $data is the post field retrieved from the client request.
How can we do that?
Thanks,
Kapil - unRuleY_95363Historic F5 AccountYou would need to run HTTP::collect when you detect that you are dealing with the form. Then in the HTTP_REQUEST_DATA event, you need to search for the field and can then rewrite the uri to include the data. Try searching for collect and HTTP_REQUEST_DATA to see some examples of collecting HTTP payload.
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