23 Making HTTP Requests

This chapter covers

  • Using the built-in Angular features for HTTP requests
  • Receiving data from HTTP requests
  • Setting headers in HTTP requests
  • Handling HTTP request errors

All the examples since chapter 9 have relied on static data that has been hardwired into the application. In this chapter, I demonstrate how to use asynchronous HTTP requests, often called Ajax requests, to interact with a web service to get real data into an application. Table 23.1 puts HTTP requests in context.

Table 23.1. Putting Asynchronous HTTP Requests in Context
Question Answer
What are they? Asynchronous HTTP requests are HTTP requests sent by the browser on behalf of the application. The term asynchronous refers to the ...

Get Pro Angular 16 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.