iRule: New request after get response

Can I check response after receiving answer and run another request? This is necessary to check if the user is blocked. If the user is not blocked, give his result from another enpoint.

Something like:

Send POST request /method1

when HTTP_REQUEST { 
	if { [HTTP::uri] == "/method1" } 
	{
		pool checkblock 
	} 
}

when HTTP_RESPONSE {  if { [HTTP::status] != 401} {
    REWRITE /method1 ????

How to do it? Is this a typical task for f5?

If your goal is to send them elsewhere on a 401 then you can redirect them to the alternate endpoint.

<span class=""># Redirect on 401 avoiding a redirect loop<br></span>when HTTP_RESPONSE <span class="">{<br></span><span class=""><span class="">  <span class="">if <span class="">{ <span class="">[<span class="">HTTP<span class="">::status<span class="">] <span class="">== <span class="">401 <span class="">} <span class="">{<br>    if { [HTTP::uri] ne "/method1" } {
      HTTP<span class="">::<span>redirect <span class="">"/method1"<br>    }<br>  <span class="">}
<span class="">}</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>