voldemortresolute
voldemortresolute

Reputation: 31

Excluding “ when using StringEscapeUtils.escapeHtml4

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?

Upvotes: 3

Views: 458

Answers (0)

Related Questions