'Nodejs - support backslash in json

I want to keep backslash when I am doing JSON.parse().

I have created a proxy service to hit a third-party service on my microservice application.

API -> POST <base_url>/api/v1/action

{
  "prop1": "test",
  "config": {
    "username": "testuname",
    "password": "test\f123"
  }
}

When I retrieve the password after parsing the JSON, I will be changed from test\f123 to test123. That third-party product is supporting backslash in their password. So, one of the customer had used backslash.

Is there a way to stop removing this backslash in nodejs?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source