Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Node.js for Beginners

You're reading from  Node.js for Beginners

Product type Book
Published in May 2024
Publisher Packt
ISBN-13 9781803245171
Pages 382 pages
Edition 1st Edition
Languages
Author (1):
Ulises Gascón Ulises Gascón
Profile icon Ulises Gascón
Toc

Table of Contents (25) Chapters close

Preface 1. Part 1: Node.js Overview and JavaScript Language
2. Chapter 1: Introduction to Node.js 3. Chapter 2: Setting Up the Development Environment 4. Chapter 3: JavaScript Fundamentals 5. Chapter 4: Asynchronous Programming 6. Part 2: Node.js Ecosystem and Architecture
7. Chapter 5: Node.js Core Libraries 8. Chapter 6: External Modules and npm 9. Chapter 7: Event-Driven Architecture 10. Chapter 8: Testing in Node.js 11. Part 3: Web Application Fundamentals
12. Chapter 9: Handling HTTP and REST APIs 13. Chapter 10: Building Web Applications with Express 14. Part 4: Building Solid Web Applications with Node.js
15. Chapter 11: Building a Web Application Project from Scratch 16. Chapter 12: Data Persistence with MongoDB 17. Chapter 13: User Authentication and Authorization with Passport.js 18. Chapter 14: Error Handling in Node.js 19. Chapter 15: Securing Web Applications 20. Part 5: Mastering Node.js Deployment and Portability
21. Chapter 16: Deploying Node.js Applications 22. Chapter 17: Dockerizing a Node.js Application 23. Index 24. Other Books You May Enjoy

Mastering HTTP

Now that we have a better understanding of the HTTP concept, let’s take a look at the different parts of HTTP that we need to understand in order to build a web application.

We have already seen the request and response, but let’s take a deeper look at the different parts that compose the request and the response (headers, payloads, versions, and methods).

HTTP headers

Each request and response has a set of headers. These are key-value pairs and provide additional information about the request or the response.

While both the request and response headers may look similar, they are not the same, although they do share common key-value pairs.

Request headers

We will start by analyzing in Figure 9.6 what is included in the request header:

Figure 9.6 – Attributions and copyright licensing by Mozilla Contributors is licensed under CC-BY-SA 2.5

Figure 9.6 – Attributions and copyright licensing by Mozilla Contributors is licensed under CC-BY-SA 2.5

Let’s group the different header properties:

  • Representation...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime