Application Layer
In the last section, we explored how to establish a TCP or UDP connection between two nodes to transfer bytes over the network using Go low-level network primitives we have learned so far. Now we focus on the top layer of the TCP/IP model and go into the application-level constructs that Go includes on the standard library to implement HTTP clients and servers.
To illustrate this, we go through the steps to build a client-server application that returns MAC address vendor, IP address owner or domain detailed information to the requester. On the client side, we need to craft an HTTP request that encapsulates the query to the server address. On the server side, we need to listen for requests, and implement the logic to serve them and reply with the information for the argument received.
Working with an HTTP Client
On the client side, we first need to put together the URL where we send the request to. The URL, for our example, has three components: * The server address...