Skip to content

JSON escape quotes #574

Description

@RedLens834

Hi,

I'm getting JSON from PHP server with curl and I save it to a std::string variable.
So :
std::cout << input;
// {"error":"params problem","vector":"A5+myu8a5QW7Gk98mWws7A=="}

I'd like to deserialize this into a JSON object by doing :
json decodedJson(input)
But here when I make a print of input.dump(4) I'm getting just an escaped string of input.

So I tried a different way :
json decodedJson = json::parse(readBuffer);
And here I have this following error :
libc++abi.dylib: terminating with uncaught exception of type nlohmann::detail::parse_error: [json.exception.parse_error.101] parse error at 1: parse error - unexpected '?'

Is it normal ?
Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions