This project presents a small example describing how to make api calls using libcurl, the example is nearly completely based on this curl example. An example for parsing json formatted responses is also provided using nlohmann/json. Example api calls are made to chubin/wttr.in.
- The newest version of clang or gcc is recommended.
- The project should compile as long as your compiler supports c++11.
- cmake > 3.6
- libcurl
You will have to figure out how to install those dependencies, for your specific system, on your own!
This example applies on Mac-os and Linux. I do not know how one would build and run this project using Windows. I do suggest to RTFM if you do not know either, and want to run the project on Windows.
To build project run:
mkdir build
cd build
cmake ..
make
The binary "cppWeather" should be found in the ./build directory. To run the project:
./cppWeather