Forum Discussion

darraghor's avatar
darraghor
New Contributor
9 years ago

Project Event and request content with evaluated properties

Hey,

 

I'm trying to run a Groovy script in the project level events (requestfilter.FilterRequests) and I need the fully evaluated content/body of my request to calculate a hash on the content. The problem is my request uses properties so If I use request.requestcontent I get the content un processed e.g.

 

"bodyColor":"{$myProperty}". however by the time this is sent out it is of course processed and the server hashes "bodyColor":"blue".

 

Anyone have an idea of a property or method in the context of requestfilter.FilterRequests that has the request content with values already assigned to properties?

 

thanks,

dar

  • I found out that to evaluate the properties in the request you have to call context.expand on it

     

    so the correct answer is... context.expand(request.requestContent)

     

     

3 Replies