An API call is an HTTP request sent by a client to a server to interact with a resource. It specifies an operation with a verb and path, and can carry headers and a body. The server processes the request and returns an HTTP response. section 1.4.1
A call moves through a simple request-response flow:
- The client sends a request containing a verb, a resource path, and optionally headers and a body. section 1.4.1
- The request travels to the server associated with the hostname, where the application processes it. section 1.4.1
- The server returns a response with a status code and, optionally, headers and a body. section 1.4.1
- In ASP.NET Core, Kestrel receives the raw request, constructs an HttpContext, and sends the application's response back to the network. section 1.4.2
Requesting a web page
Entering a web address causes the browser to send an HTTP request to the server. The application interprets the request, generates HTML, and returns it in an HTTP response for the browser to display. section 1.4 section 1.4.1
Figure 1.2 Requesting a web page. The user starts by requesting a web page, which causes an HTTP request to be sent to the server. The server interprets the request, generates the necessary HTML, and sends it back in an HTTP response. Then the browser can display the web page.
Follow the request from the user's browser to the server and back as HTML displayed on the page. section 1.4.1
Figure 1.3 How an ASP.NET Core application processes a request. A request is received by the ASP.NET Core application, which runs a self-hosted web server. The web server processes the request and passes it to the body of the application, which generates a response and returns it to the web server. The web server sends this response to the browser.
Trace how an ASP.NET Core application receives a request, processes it, and returns a response through its web server. section 1.4.2


