Skip to content
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

Some Help please #1478

Closed
kenkit opened this issue Feb 12, 2019 · 2 comments
Closed

Some Help please #1478

kenkit opened this issue Feb 12, 2019 · 2 comments
Labels
kind: question solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@kenkit
Copy link

kenkit commented Feb 12, 2019

How do I access the keys within the array ?
{"jsonrpc":"2.0","method":"aria2.onDownloadComplete","params":[{"gid":"5c6b48f1a09df47f"}]}

I want to access the values within params.

e.g myjson["params"]["gid"].get<std::string>()

@jaredgrubb
Copy link
Contributor

myjson["params"][0]["gid"].get<std::string>() (you need to say which element of the array you want, so [0] will do that)

@kenkit
Copy link
Author

kenkit commented Feb 13, 2019

Ohhh, yeah. Thank you @jaredgrubb .

@kenkit kenkit closed this as completed Feb 13, 2019
@nlohmann nlohmann added kind: question solution: proposed fix a fix for the issue has been proposed and waits for confirmation labels Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

No branches or pull requests

3 participants