Introduction
In the previous chapter, you looked at web APIs with REST. You learned what REST is, how to think about API design, resources, and errors in REST, as well as the problems with REST and some of its alternatives.
In this chapter, you will learn about the Go HTTP Client and how to use it. An HTTP client is something that is used to get data from or send data to a web server. Probably the most well-known example of an HTTP client is a web browser (such as Firefox, Chrome, and Microsoft Edge). When you enter a web address into a web browser, it will have an HTTP client built in that sends a request to the server for data. The server will gather the data and send it back to the HTTP client, which will then display the web page in the browser. Similarly, when you fill out a form in a web browser, for example, when you log in to a website, the browser will use its HTTP client to send that form data to the server and then take appropriate action, depending on the response.
...