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

Parsing JSON from a web address #1311

Closed
RubberDucky32 opened this issue Oct 22, 2018 · 2 comments
Closed

Parsing JSON from a web address #1311

RubberDucky32 opened this issue Oct 22, 2018 · 2 comments

Comments

@RubberDucky32
Copy link

Hi there,

I'm new to the forum and recently starting using this library. Quick question..

For my project I need to parse JSON data from a web address..something that looks like this: https://public-api.adsbexchange.com/VirtualRadar/AircraftList.json?lat=37.995956&lng=-119.035278&fDstL=0&fDstU=50

Once I get that loaded into C++ all is happy. Does this library offer the capability to do such a thing? I've been looking through the documentation and can't seem to find anything.

I believe in python I could do something like this:

json.loads(URL)

Is there an equivalent in nlohmann/json?

Cheers and thanks!

@nlohmann
Copy link
Owner

The library can parse from streams or strings, but not from URLs. You need to download the JSON with a different library and then use this library to parse the received data.

@RubberDucky32
Copy link
Author

RubberDucky32 commented Oct 22, 2018 via email

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

No branches or pull requests

2 participants