Forum Discussion
Irule to rediect POST request from HTTP to HTTPS
Hi All
I have a query regarding redirecting of POST requests from HTTP to HTTPS, I am trying to see if it possible via an Irule?, I know the default behaviour is to redirect to a GET but I am hoping to preserve the POST and redirect to HTTPS, I have had a read of a few forum articles and cant tell if anyone has any success in this implementation.
I currently have an irule which query's for a soapaction header and I then want to force the POST into HTTPS along with a pool redirect, is this possible in any way? I am able to get it working all over HTTP but ideally would want this over HTTPS
Thanks
4 Replies
- Stanislas_Piro2
Cumulonimbus
Hi,
There is no limitation on method after redirect.
If the initial method was a post, the browser will send a post to the redirect url.
- Annsar_Akhtar
Nimbostratus
So I should be able to force the POST request with the custom soapaction header to HTTPS? The request is a POST response.
I am struggling to get this working as I can see this being changed to a GET and stripping out the data from the POST.
- nathe
Cirrocumulus
You'll need to use 307 code instead of the usual 302. See this post for help:
https://devcentral.f5.com/questions/how-to-preserve-data-in-a-http-302-redirect-of-a-post
Hope this helps
- Annsar_Akhtar
Nimbostratus
Thanks for that, I did have a read of that article after reading something similar on stackoverflow, the 307 performs a temporary redirect with the post response intact.
Thanks again
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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