排除“使用StringesCapeutils.escapehtml4时
我正在尝试消毒请求机构。为此,我将对象转换为JSON,然后将JSON转换为
requestBody
{
"data": {
"id": "123",
"unit_id": "456",
"country": "jp",
}
}
stringescapeutils.escapehtml
输出后逃脱:
{"data":{"id":"123","unit_id":"456","country":"jp"}}
当我尝试将JSON转换回对象时,它正在逃脱双引号(“),它正在破坏JSON结构。
在此过程中,我如何单独排除双引号(“)?
I am trying to Sanitize the requestBody. For this purpose I am converting Object to Json and then passing the Json to
requestBody
{
"data": {
"id": "123",
"unit_id": "456",
"country": "jp",
}
}
StringEscapeUtils.escapeHtml
Output post escaping:
{"data":{"id":"123","unit_id":"456","country":"jp"}}
It is escaping the double quotes(“) which is breaking the Json structure when I am trying convert the Json back to Object.
How I can exclude double quotes(“) alone during this process?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论