C++ API

Hello I wanted to make a C++ API program. Haven't done this before so now idea..
What Libraries to use??
Can anyone help and provide a basic sample code program [C++] API program ?
I am going to use this API though https://railwayapi.com
Thanks for help. Please provide a blueprint/sample code

Please provide a blueprint/sample code
No one is going to do your job for you, especially not for a large railroad system. (Least of which for the potential legal morass.)*

It is exceedingly likely that railwayapi.com has example C++ code on their site (disclaimer: I have not bothered to look past the site’s main page). You should start by writing any small program that uses it to do things like get the estimated arrival time of the next inbound train at some station, or the cost of tickets between two stations, etc.

Once you have written a few small functional programs that use the library you should be comfortable enough to start writing the thing you are paid to do.

*Not unless you pay $$$ and offer a signed liability contract.

What Libraries to use??

Besides the railwayapi.com library?

It depends entirely on the scope of your project. What libraries do you need to integrate the program into production?

Good luck!
I am not like pro at C++ so i dont know much regarding libraries except iostream, fstream and so on...
So to use which API and commands? I needed documentation for that..
Like say GET/REQUEST In Java, but i need such commands in C++ so...documentation :-)

and I didn't saw any "example" on the site though, its just JSON reponse and few links to understand..
Last edited on
Ah. The basic libraries you need are:

 • libcurl
 • jsoncpp

Since libcurl is a C library, you may also want to get:

 • curlpp

Google around these for all kinds of examples and documentation, in addition to download links.

[edit]
RE: libraries

The C++ Standard Library comes with the compiler. You generally don’t have to do anything special to use it.

External libraries will often require you to compile them. Hint: google around "libcurl binary" to get versions you do not have to compile.

You will still need to learn how to add the library .lib/.a files and header files to your compiler. This is a topic on its own. Google around your compiler’s name and "how to use a library" and things like that.

Good luck!
Last edited on
OK Thank you :-)
I will look around for those libraries once...
But i too was looking for them earlier... I did had found libcurl
But wasn't able to find the GET type codes like in Python
from telegram.ext.dispatcher import dispatcher

So I am unable to figure out what keywords do I need to import in C++.
Also the API i mentioned above has given only commands regarding JSON .. So :-(
Also if there is any sort of documentation, I would be pleased :)
Topic archived. No new replies allowed.