Forum Discussion
6 Replies
Sort By
- hooleylistCirrostratusI don't think you can set the method with HTTP::method. The wiki page only shows that you can retrieve the method--not set it. If you could change the request method, I'm not sure it would be a good idea. You'd have to try to handle any POST data that was sent with the request.
when HTTP_REQUEST { if {$some_condition == 1}{ HTTP::redirect http://[HTTP::host][HTTP::uri] } }
- Patrick_Chang_7Historic F5 AccountYou can do it, but you would have to manually recreate the request in its entirety. This would require parsing the post data and converting them into query parameters in the URI. There is a secret function (not well documented) in the F5 Web Accelerator which will do this for you automatically.
- Lars_Terje_VaalNimbostratusInteresting, but we do not have the Web Accelerator license.
when HTTP_REQUEST { set orginal_request [HTTP::request] } when HTTP_RESPOND { if {some condition} { HTTP::retry $orginal_request } }
- hooleylistCirrostratusI don't think there is a way to change the method using HTTP:: commands. I suppose you could collect the TCP data and replace the POST string with GET within the TCP payload. I don't think it would be a simple thing to do though.
- hooleylistCirrostratusI would think you could modify the variable you're saving the request to, $orginal_request, before using HTTP::retry $orginal_request.
- Lars_Terje_VaalNimbostratusI found the solution now on how to do a HTTP::retry if the request method is POST
when HTTP_REQUEST { set orginal_request [HTTP::request] HTTP::collect [HTTP::header "Content-Length"] if {$isRetry} { HTTP::header replace Content-Length "0" HTTP::payload replace 0 0 $payloadReq set isRetry 0 } } when HTTP_REQUEST_DATA { set payloadReq [HTTP::payload] } when HTTP_RESPOND { if {some condition} { HTTP::retry $orginal_request set isRetry 1 } }