REST is an abbreviation of REpresentional State Tranfter introduced in a doctoral dissertation of Roy Fielding who is the co-founder of HTTP in 2000. REST was proposed in order to solve the problem that existing Web-Services cannot actively use HTTP. At first glance, REST is recognized as a protocol to replace HTTP, but REST is not a protocol. REST is an Architectural Style & Design for Network based Software Architecture. Many people mistake REST as a protocol of WEB Application like SOAP(Simple Obeject Acess Protocol). However, REST is a Design Paradigm describing the operation principle of WEB Application and the operation efficiency.
REST completely places emphasis on Resource-centered design. REST also uses Method POST / GET / PUT / DELECT corresponding Create / Read / Update / Delete (CURD) for their purposes. Thereby, REST started changes from Service-centric Web Application(SOA – Service, Verbs) to Resource-centric Web Application(ROA – Resource, Nouns).
Let’s understand that REST is a theory of design. People describe the design for REST Architecture as “RESTful”.
REST is actively applied under the leadership of Open Service companies such as Google, Amazon, Flicker, Tweeter. As effect, REST is beoming the Defecto Standard.
This post will introduce projects created using REST Architecture based on Web from mbed.
The first project is MiMicRemoteMCU-for-Mbed.
MiMicRemoteMCU is a project that can control mbed(LPC1768/LPC4088/LPCXpresso1769) via web browser using REST Architecture.
The second project is STM-Client.
This project shows how to acquire information via GET Method by contacting the http://www.timeapi.org/ server using REST Architecture.
This server has the following URI. The server will send the time information to match if users send this form of URL to the server via GET Method.
- /utc/now → Current UTC time
- /pdt/in+two+hours → Time two hours from now in PDT
- /pdt/next+monday → Datetime for next Monday in PDT
- /pdt/this+friday+at+noon → Datetime for this Friday at noon in PDT (“friday noon” works too)
- /pdt/7+hours+before+tomorrow+at+noon → I think you get the point.
The third project is HuxleyIntergrationAPI.
This project shows how to send and receive data of takeoff and landing of airplanes between mbed devices and a web-server called, https://huxley.unop.uk, using JSON format based on REST Architecture.
The last project I would like to introduce is WIZwiki-REST-io using WIZwiki-W7500 registered on mbed platform.
This project shows how to monitor and control the value of the resource in the server from the outside by adding server based on REST to WIZwiki-W7500.
Please refer to the following picture for more information.
Since WIZwiki-REST is registered as a WIZwiki-W7500 Platform, it has objects in JSON format. When it receives the requested DATA via POST, GET, and PUT method, the received DATA is changed into JSON format and the objects will be compared.
If this is true, it the parsing value in DATA via callback function is updated as the value of Object.
Also, Client is implemented using a mobile phone application.
Objects of WIZwiki-REST were defined as Peripheral pins and were enabled to bring the value of Analog or operate Components via Peripheral by adjusting the value of Object via Client.
Users can easliy control via not only application but also cURL
As time passed, the proportion of REST among Internet API is increasing. This means that it is more portable and stateless than SOAP and API based on REST may further utilize the features of Web Protocol based on HTTP. As a result, the proportion of REST is expected to increase even more.
Curator : Lawrence in WIZnet
You can contact to email@example.com