Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

replace response.content in AssignMessage Policy

Hi All,

I have read the documentation on replacing strings in the response content. Seems there are two ways: via AssignMessage Policy or via a Javascript Policy. Is there any performance difference between these methods?

Also I am wondering why my policy doesn't work.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage name="AM-Set-Custom-Response">
    <AssignTo createNew="false" type="response"/>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <Set>
        <Payload>{replace(response.content, '^https://urltoreplace/','https://replacementurl')}</Payload>
    </Set>
</AssignMessage>   

Thanks again for all the support this community provides.

0 1 712
1 REPLY 1