Skip to content
Advertisement

Need to parse JSON string with value is quoted curly braces

I need to parse JSON string.

I’ve tried JSON.stringify and then JSON.parse below sample string, but server performed escape sequencing

I used str.replace('/\/g','') to remove the escape sequence but that doesnt help because if you look in the "default_request" key is wraps its value with "" which is doesnt allow me parse it using JSON.parse()

JavaScript

so I tried to replace "{ with { and }" with }

JavaScript

but it creates another problem.

JavaScript

Advertisement

Answer

default_request was stringifyied twice. to fix it, try this

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement