Forum Discussion
mikey_webb
Cirrus
May 30, 2019iRule to intercept request and respond to client with content
Please help
Require an iRule to intercept a specific URI pattern and when the pattern is received instead of going to the pool return
an HTTP response code 200 back with the following content {"result":null,"errors":[],"warnings":[],"hasErrors":false,"hasWarnings":false}
Many thanks for any guidance
- Lee_Sutcliffe
Nacreous
Try this
when HTTP_REQUEST { set message "{\"result\":null,\"errors\":[],\"warnings\":[],\"hasErrors\":false,\"hasWarnings\":false}" if {[HTTP::uri] equals "/my/path"} { HTTP::respond 200 -version 1.1 content $message noserver "Content-Type" "application/json" "Connection" "close" } }
- mikey_webb
Cirrus
Thanks Lee - initial testing shows this as working
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