# A Web of Things-Based Emerging Sensor Network Architecture for Smart Control Systems
## 3 WoT-ESN over REST Architecture  
In general, Web services have emerged widely during the last two decades, and the integration of Web services with the physical things have shown prominent improvements and developments in the recent past. Several architectures were proposed to enable Web services to interact with the existing physical objects. They have mainly categorized into two groups, i.e., (1) Big Web services and (2) RESTful Web services. In the case of Big Web services or WS_*, interested readers are referred to [31]. The RESTful Web services are becoming popular for the Web connectivity of heterogeneous smart devices [32]. REST is an architecture which is mainly used to explain the workings of HTTP as an application layer protocol. However, the working mechanism of the HTTP is explained in a broader sense separating the traditional use of HTTP from the Web services of physical things. Similarly, RESTful is said to be an Application Programming Interface (API) supporting the REST style. Apart from explaining the basic concept of the REST architecture, many researchers are working on designing Resource Oriented Architectures (ROAs) based on REST. One of the main reasons for employing REST for ROA is its simple architecture and great compatibility with physical and embedded devices. A ROA based on REST follows four basic concepts that are given below:  
* Resources: Anything able to provide a service and have the ability to attach with another resource.
* Uniform Resource Identifiers: Naming a resource helps in addressing and discovering a resource over the Web. The URI is used to uniquely identify a resource.
* Linking Resources: The Web provides the structure for linking via hyperlink functionality. This functionality helps to connect resources with each other over the Web. The RESTful API uses this functionality for connectivity.
* Representation of Resources: The restful API uses the XHTML format for representing resources over the Web because of its smooth readability and support for browsing.  
REST also uses various kinds of HTTP methods to manipulate resources. However, the following four are very commonly used methods:  
1. GET: The GET method retrieves the current state of a resource. For example, sending a GET request with a resource URI (http://.../MS/coordinator1/sensor2_1/fan1/energy) will return the energy consumption of the fan in a smart home.
2. POST: The POST method is used to change the state of a household appliance. For example, a switch off request (http://.../MS/coordinator2/sensor2_2/fan2/Turnoff) is used to switch off a household appliance
3. PUT: The PUT method is used to insert a new resource or modify the existing one. Whenever a new household appliance is added to the smart home, a PUT method is called upon to add it to the resource list.
4. DELETE: Whenever a household appliance is removed from the house. It is important to delete it from the resources list using DELETE method.  
The RESTful API is a more convenient and simple solution for the next generations of constraint oriented applications. RESTful APIs are also supported by the HTTP protocol and thus a researcher has a choice of a wide HTTP libraries and clients.