It's pretty much the tittle. Im not expecting the whole code to just copy and paste (but feel free to do it). Im just having difficulties to find some data related. If someone knows how to do it, please post some hints, article links, specific words to make some research on it. Thank you.
2 Answers
As Christian mentioned in his comment, your problem can be solved by implementing an HTTP client that parses JSON responses, independently of the technology used by your server. To do this in C++, I would refer you to the following resources:
- High-level library for C++ HTTP client.
libcurl(lower level library for HTTP requests).- RapidJSON library to parse the responses you will get from your server (see this benchmark for a comparison of JSON parsing libraries).
If your C++ application uses a framework such as Qt, it likely includes facilities for requests (e.g. Qt HTTP example).
On the server side, you will have to define HTTP endpoints that return the data you are interested in, encoded as JSON. The beginning of this tutorial shows an easy way to do that.
1 Comment
node.js c++ add on manual
Content-Type: application/json. How the server is implemented must be irrelevant for the client. It's like asking "I want to plug my washing machine's cable into a type C socket. Electricity comes from a coal-fired power plant."