Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RESTful Client API in C++

Tags:

c++

Is there any open source library available that implements RESTful Client(library for interpreting HTTP requests as REST service calls) in C++ ?

My requirement is to connect to Amazon Web Services and get the list of EC2 instances(and their details) available for given user account in C++.

I know Amazon provides API's for this in Java, C#. But I want in C++. If Amazon provides in C++ too, that would be fine, Please guide me.

Your help is much appreciated.

Regards

Bharatha Selvan.

like image 784
Bharatha Selvan Avatar asked Nov 19 '10 07:11

Bharatha Selvan


People also ask

What is REST API in C?

A REST API (also known as RESTful API) is an application programming interface (API or web API) that conforms to the constraints of REST architectural style and allows for interaction with RESTful web services. REST stands for representational state transfer and was created by computer scientist Roy Fielding.

Can you make API calls in C?

Applications call C API functions defined in C language header files, and a dynamic link library (DLL). Each function call returns an integer result code, defined in the ctgstdat. h header file. A function that completes normally returns the code CTG_STAT_OK .

What is a RESTful API example?

A RESTful web service request contains: An Endpoint URL. An application implementing a RESTful API will define one or more URL endpoints with a domain, port, path, and/or query string — for example, https://mydomain/user/123?format=json .

Can you build a REST API with C++?

The C++ REST SDK is designed and written from the ground up using modern C++. Features include: Support for accessing REST-based services from native code on Windows Vista, Windows 7, Windows 8, Windows Store apps, and Linux by providing asynchronous bindings to HTTP, JSON, XML, URIs, and so on.


2 Answers

You need to parse XML. I suggest you try Qt C++ Toolkit it will give you a QHttp instance to make HTTP calls and QtXml module to parse the xml. This way you can create a C++ Rest Client.

like image 157
Ankur Gupta Avatar answered Sep 29 '22 07:09

Ankur Gupta


You should try the ffead-cpp web framework. It has a host of other features like Dependency Injection, Serialization, Limited Reflection, JSON etc to name a few. Do check it out...

like image 38
Sumeet Avatar answered Sep 29 '22 06:09

Sumeet