Forum Discussion
Thiyagu
Cirrus
May 22, 2024Need help with an iRule for HTTP Methods
Could you please review the below iRule and suggest? when HTTP_REQUEST { if { ( [HTTP::method] equals "PUT" ) } { switch -glob [string tolower [HTTP::uri]] { "/rws/api/v1/devices/*" -...
Paulius
MVP
May 22, 2024You should copy these iRules as is.
First iRule
when HTTP_REQUEST priority 500 {
set URI [string tolower [HTTP::uri]]
if { ( [HTTP::method] == "PUT" ) } {
switch -- -glob ${URI} {
"/rws/api/v1/devices/*" -
"/rws/api/v1/accounts/*"
{
pool POOL_POD1_RWSDEVICE
}
}
} elseif { ( [HTTP::method] == "POST" ) } {
switch -- -glob ${URI} {
"/rws/api/v1/accounts/*"
{
pool POOL_POD1_RWSDEVICE
}
default
{
pool POOL_POD1_RWS
}
}
}
}
Second iRule
when HTTP_REQUEST priority 500 {
if { ( [HTTP::method] == "PUT" ) } {
switch -- -glob ${URI} {
"/x/*" -
"/y/*"
{
pool PUT_X_Y
}
}
} elseif { ( [HTTP::method] == "POST" ) } {
switch -- -glob ${URI} {
"/x/*"
{
pool POST
}
}
}
default {
pool POOL1
}
}
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