Forum Discussion

Pradeep_Kandala's avatar
Pradeep_Kandala
Icon for Nimbostratus rankNimbostratus
Nov 02, 2012

Facing issue in HTTP::collect, HTTP::payload

Hi Guys,

 

I have a nice working IRULEs code, but for my additional operations, I'm trying to fetch the complete body from post method using the below code.. but it hangs when I add the code.

 

I'm not finding the proper literature which gives clear idea to use HTTP::collect and HTTP::payload

 

in HTTP_REQUEST

 

if {[HTTP::method] equals "POST"} {

 

if {[HTTP::header Content-Length] > 1 && [HTTP::header Content-Length] < 7000} {

 

set content_length [HTTP::header Content-Length]

 

Use default collect length

 

[HTTP::collect [HTTP::header Content-Length]]

 

log local0.info "10.0023- Printing the SAML response: $SAMLResponse IP: [IP::client_addr]"

 

}

 

}

 

 

when HTTP_REQUEST_DATA {

 

do stuff with the payload

 

set SAMLResponse [HTTP::payload]

 

log local0.info "60.0000- Printing the SAML response: $SAMLResponse IP: [IP::client_addr]"

 

HTTP::release

 

}

 

 

Thanks a lot in advance,

 

Pradeep

 

3 Replies

  • [HTTP::collect [HTTP::header Content-Length]]i do not think you need outer bracket.

     

     

    these are more examples. the latter one is to collect response, so you have to modify it for request.

     

     

    HTTP::collect Wiki

     

    https://devcentral.f5.com/wiki/irules.HTTP__collect.ashx

     

     

    HTTP Payload Collection CodeShare by Deb

     

    https://devcentral.f5.com/wiki/iRules.HTTPPayloadCollection.ashx
  • That was not the issue, its not working if length is above 200, the data ai send is more than 5500. not able to get the resolution