Forum Discussion
Darren_Young_10
Nimbostratus
Mar 11, 2010Remove headers on GET vs. POST
How could I remove headers on a GET vs. a POST request?
hoolio
Cirrostratus
Mar 11, 2010You can check the request method and URI in HTTP_REQUEST and then set a variable to track that you want to remove the Cache-Control and Pragma headers from the response. I'm not sure whether you only want to check GETs or POSTs, but here's an example which checks POSTs:
when HTTP_REQUEST {
set remove_headers 0
if {[HTTP::path] contains "some/string"}{
if {[HTTP::method] eq "POST"}{
set remove_headers 1
}
}
}
when HTTP_RESPONSE {
if {$remove_headers}{
HTTP::header remove Cache-Control
HTTP::header remove Pragma
}
}
Aaron
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