REST API Requests in Go
What is REST? REST (REpresentational State Transfer) is an architectural style for designing and developing APIs that could be used for client and server interactions. REST defines 6 architectural constraints for APIs: Uniform interface: API requests for a resource should look the same irrespective of its origin client. The Uniform Resource Identifier (URI) allocated to resources should be unique. Client-server: Changes on the client side should not affect the server and vice-versa. Stateless: The API request should contain all the resources required to process it. The server should not store any details related to client requests. Cacheable: API Responses could be cached on the client or server side. Layered system: Neither the client nor the server should have information regarding the number of intermediate layers during communication. Code on demand (optional): When required, code snippets sent through API responses should be executable on demand. APIs that comply with REST architecture constraints are called RESTful APIs. ...