The HTTPURLResponse class is a subclass of the URLResponse class, which encapsulates the metadata associated with the response to a URL request. The HTTPURLResponse class provides methods for accessing specific information associated with an HTTP response. Specifically, this class allows us to access the HTTP header fields and the response status codes.
We briefly covered several classes in this section and it may not be clear how they all actually fit together; however, once we explore the examples a little further in this chapter, it will become much clearer. Before we go into our examples, let's take a quick look at the type of service that we will be connecting to.