CloudPlugs REST Client for ANSI C is a library to perform HTTP requests to CloudPlugs servers. The official repository is: https://github.com/cloudplugs/rest-c
Cloudplugs is a cloud based IoT platform to enable the fast prototyping, connection, deployment and management of smart "Things" (sensors, smartphones, home appliances, etc.). Different objects can interact with each other by publishing and/or reading any type of data on shared channels through simple communication protocols. You can learn more at http://www.cloudplugs.com/how-it-works/ and you can sign-up on http://www.cloudplugs.com/register to start connecting your Things.
List of external libraries to be included:
The library provides a set of configuration options, and the functionalities to perform HTTP requests to Cloudplugs server. According to Cloudplugs Rest Api documentation, the body of HTTP request must be a JSON encoded string containing request's parameters. For this reason the library provides two functions for each request:
Include other dependencies:
Create a new session and initialize the data required:
Now you are ready to configure the library and invoke functions to perform REST requests to the server!
Finally close and clean the session:
There are a few configuration parameters available for customization (if needed) before invoking any request. This parameters are:
After completing the configuration, you can execute HTTP requests to the server by invoking any of the request functions. All the requests are synchronous and are executed per the Cloudplugs Rest API documentation. For example:
Or, if using the Jansson JSON library :