A RESTful Server
Let’s learn how to develop a RESTful server.
We'll cover the following
The purpose of the presented implementation is to understand how things work behind the scenes because the principles behind REST services remain the same. The logic behind each handler function is simple: read user input and decide whether the given input and HTTP method are the desired ones. The principles of each client interaction are also simple: the server should send appropriate error messages and HTTP codes back to the client so that everyone knows what really happened. Lastly, everything should be documented to communicate in a common language.
Coding example
The code of the server, which is saved as rServer.go
, is the following:
Get hands-on with 1200+ tech skills courses.