Forum Discussion
Amine_Kadimi
MVP
when HTTP_REQUEST {
if {[HTTP::method] eq "POST"}{
if {[HTTP::header "Content-Length"] ne "" && [HTTP::header "Content-Length"] <= 1048576}{
set content_length [HTTP::header "Content-Length"]
} else {
set content_length 1048576
}
if { $content_length > 0} {
HTTP::collect $content_length
}
}
}
when HTTP_REQUEST_DATA {
log local0. "Token = [findstr [HTTP::payload] "token=" 6 &]"
}
Daniel_Wolf
Feb 04, 2021MVP
This is the way, however I would be careful to implement it. I'd recommend to do performance testing before deploying it in a production environment.
Just recently I had a similar requirement and it works good with small requests. However the customer had POST requests up to 400kb. Then this suddenly becomes heavy on the CPU.