Posts Tagged ‘REST’

Arduino RestServer Library [restful architecture]

Tuesday, November 22nd, 2011

This simple library was designed to enable your Arduino to respond to RESTful resource requests via Ethernet or Serial connections. Unlike most existing RESTful libraries for the Arduino, RestServer enables you to describe your own resources and to define how the Arduino should respond to each resource request rather than automatically map resources to pin numbers on the Arduino.

The intent of this design approach is to embed knowledge about the resources available on a given Arduino locally on the device itself. This local knowledge enables the Arduino to inform client devices about the resources are available, along with relevant information about the resources such as resource range and types of requests supported.

Here is a flowchart that describes how the RestServer library works:

Here is an overview of the main features provided by this library:

  • Create your own custom resource lists
  • Define how your device should respond to resource requests
  • Works with clients via Serial and Ethernet connections
  • Responds to queries regarding available resources
  • Provides response in html or json formats
  • Renders html form for resources that support POST requests
  • Supports GET and POST requests
  • Features options to enable state updates via GET requests

To download the library, and to view more detailed instructions on how to setup and interface with RestServer, check out the github repository here. Please note that this is the first version of this library and that it has been tested by only one person (me). Therefore, please let me know if you encounter issues when using it.