Forum Discussion
THi_89722
Nimbostratus
Mar 05, 2015How to add missing Content-Length header to an HTTP POST request?
Have tried to send an APM HTTP Auth POST request to external authentication server which requires Content-Length header. Seems to be that APM HTTP Auth does not calculate and add the Content-Length h...
JRahm
Admin
Mar 06, 2015Can you post what you tried? Something like this perhaps? (to be applied on your layered vip) no need to call HTTP::release here, it's done implicitly. I'd make sure that posts hitting this vip are small, otherwise you'll want to exercise more care than I example here.
when HTTP_REQUEST {
if { [HTTP::method] eq "POST" } {
HTTP::collect
set ispost 1
}
}
when HTTP_REQUEST_DATA {
if { [info exists ispost] } {
HTTP::header insert Content-Length [HTTP::payload length]
}
}
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