Forum Discussion
lstewart_53611
Nimbostratus
Apr 15, 2010Redirect POST data while load balancing GET iRule
I am attempting to write an iRule which will allow data from a page to be redirected to an external URL, but will then deliver the followup page (simple GET data) from a vip. From everything I've bee...
Nat_Thirasuttakorn
Employee
Apr 15, 2010I am quite sure I understand your requirement thoroughly. here is what I think it is. you may try
you may change ext_uri variable to be your desired url
when RULE_INIT {
set static::ext_url "http://10.10.71.3/test.post"
}
when HTTP_REQUEST {
if { [string tolower [HTTP::method]] eq "post" } {
HTTP::collect [HTTP::header "Content-Length"]
}
}
when HTTP_REQUEST_DATA {
set content " \
"
foreach p [split [HTTP::payload] &] {
set name [getfield $p = 1]
set value [decode_uri [getfield $p = 2]]
set content "${content}"
}
set content "${content}"
HTTP::respond 200 content $content
}
feel free to let me know if you have any question
Nat
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