Is it possible to skip populating the cache based on the response of the target server? The target server should response with a Http status of 200 and a json object that includes a status property. I have put in my policy <SkipCachePopulation>(response.content.status == "FAIL")</SkipCachePopulation>. However regardless of the value of the status property the cache is alway populated.
Sample Target Service Response
{
"status": "FAILED",
"message": "Something bad happened"
}
Solved! Go to Solution.
The problem turned out to be the target server was returning text/html even though the request was for application/json. Added a step to change the response to json then an extract variable policy to read said json worked.
The problem turned out to be the target server was returning text/html even though the request was for application/json. Added a step to change the response to json then an extract variable policy to read said json worked.
Outstanding, thanks for the followup.