You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
This indicates a parse error in the first byte. The '?' looks as if there is an unexpected control character without proper ASCII representation. Could you check whether the readBuffer is valid JSON?
How damm, yes you right ! By doing std::cout << input[0] I saw ?. So I have a bad response from the server. I test that now and I come back to you.
Thanks for your help nlohmann and great work for your plugin !
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
The text was updated successfully, but these errors were encountered: