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 been reading, one cannot do a true redirect of POST data, but must rewrite the URI to achieve the result, as otherwise the payload will be lost and only GET data will be redirected. Does anyone know of a way to redirect only the post data?
That is,
A load-balanced page http:///pagename displays a form. The user then posts data which should go to http:///external page. The form however needs to then send the user to a load-balanced page http:///pagename1
Thanks in advance for any ideas.
- Nat_Thirasuttakorn
Employee
I am quite sure I understand your requirement thoroughly. here is what I think it is. you may trywhen 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 }
- Nat_Thirasuttakorn
Employee
I meant to say "I am NOT quite sure...." - lstewart_53611
Nimbostratus
I'll have to try a variation on this and see how it does. Essentially I want to redirect the post data and nothing else; I realize my explanation was a little sketchy. - Nat_Thirasuttakorn
Employee
to explain more about iRule I posted
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