Forum Discussion
5 Replies
Sort By
i dont believe so, there is not actual http payload in a http request, just the request and the headers i believe. so there is no need to change something here right?
do you have a specific situation you want to tackle?
- Andre_NurwonoEmployee
HTTP POSTs contain HTTP payloads, although in most use cases it's the HTTP headers that most customers want replaced.
- Kevin_StewartEmployee
You can replace ANY HTTP request payload in the same manner as response payload.
HTTP::payload replace 0 [HTTP::header Content-Length] "blah-blah-blah"
- hooleylistCirrostratus
As Kevin said, this certainly is possible: Here's an example from the HTTP::collect wiki page. You can also check the HTTP::payload wiki page for more info on doing the payload replacement: https://devcentral.f5.com/wiki/iRules.http__collect.ashx https://devcentral.f5.com/wiki/iRules.http__payload.ashx
From https://devcentral.f5.com/wiki/iRules.http__collect.ashx Collect a request payload when HTTP_REQUEST { if {[HTTP::method] eq "POST"}{ Trigger collection for up to 1MB of data if {[HTTP::header "Content-Length"] ne "" && [HTTP::header "Content-Length"] <= 1048576}{ set content_length [HTTP::header "Content-Length"] } else { set content_length 1048576 } Check if $content_length is not set to 0 if { $content_length > 0} { HTTP::collect $content_length } } } when HTTP_REQUEST_DATA { do stuff with the payload set payload [HTTP::payload] }
- Thinkfast_12947Nimbostratus
This is great. Thank you.