appendix-c

Appendix C. A quick introduction to HTTP

 

In this appendix, we discuss the essential aspects of HTTP that any developer needs to know. Fortunately, you don’t have to be an expert in HTTP and know its reference by heart to implement excellent web apps. On your journey as a software developer, you’ll also learn other HTTP aspects, but I want to make sure you have all the needed information to understand the examples we work on in this book, starting with Chapter 7.

Why learn about HTTP in a book about Spring? Because today most of the apps we implement with an application framework (such as Spring) are web apps, and web apps use HTTP.

We’ll begin with what HTTP is, and we’ll analyze its definition in a visual. We’ll then discuss the details you need to know about HTTP requests a client makes and how the server responds.

C.1 What is HTTP?

In this section, we discuss what HTTP is. I prefer simple definitions, so I describe it as how a client communicates with the server in a web app. Applications prefer to have rigid ways to “speak,” and the protocols offer the rules they need to exchange information. Let’s analyze the HTTP definition with a visual (Figure C.1).

HTTP

Stateless, text-based, request-response protocol that uses the client-server computing model.

C.2 The HTTP request as a language between client and server

C.3 The HTTP response: The way the server responds

C.4 The HTTP session