Plan for building a REST API client

Till now, we mainly focused on writing server-side REST APIs. Basically, they are server programs. In a few cases, such as GRPC, we also needed the client. But a true client program takes input from the user and executes some logic. For working with a Go client, we should know the flag library in Go. Before that, we should know how to make requests for an API from a Go program. In previous chapters, we assumed the clients could be CURL, Browser, Postman, and so on. But how do we consume an API from Go?

Command-line tools are equally important as web user interfaces to perform system tasks. In business-to-business (B2B) companies, the software is packaged as a single binary instead of having multiple different pieces. As a Go developer, you should know how to achieve the goal of writing apps for the command line. Then, that knowledge can be leveraged to create REST API-related web clients very easily and elegantly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.234.150