New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to emit a JSON object? #27
Comments
This macro is just for unit-test. |
melode11, thank you for the answer. However, I still don't know how to send an object_message. The constructor of this class takes empty input, and it only has get_map() method, so "set_map()", so how can I input a set of key:value pair? I spent some time to debug the code, still could not find a workaround to send a JSON object (instead of a string in quotations). Could you please give an example of how to do that? |
|
suppose you got a json:
you need to concrete a object_message with below structure:
Do I explained clearly? |
Yes, I followed your suggestion and it works. Thanks again! |
Please post a clearly example about this. I really really need it. Thanks a lot! |
@melode11 |
@haitaoxin can you post a clearly example. I really really need it. Thanks a lot! |
Hello,
I noticed that in \test\sio_test.cpp, nlohmann mentioned that JSON will not compile on Windows:
ifndef _WIN32
include "json.hpp" //nlohmann::json cannot build in MSVC
endif
Does it mean that I cann't emit a JSON object from Win32 client? Here is my object
{
name: 'Joe',
age: 25,
car: {
photo: ,
year: 2005
}
}
If I can, could you give a simple example?
Thanks a lot!
The text was updated successfully, but these errors were encountered: