简体   繁体   English

如何在Mule中转义JSON

[英]how to escape JSON in Mule

{"response":{"message":"#[json:/offers[0]/offerHTML"}} { “响应”:{ “消息”: “#[JSON:/优惠[0] / offerHTML”}}

This is the actual response at runtime: 这是运行时的实际响应:

{"response":{"message:"" { “响应”:{ “消息:””

Is there way to escape the JSON response in mule? 有没有办法逃避m子中的JSON响应?

Depends on how you are building that payload. 取决于您如何构建有效负载。 But if you are just using strings you can use String.valueOf so that it does not evaluate the MEL expression: 但是,如果您仅使用字符串,则可以使用String.valueOf,以便它不评估MEL表达式:

#[String.valueOf('#[json:/offers[0]/offerHTML]')]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM