liveBook · Manning

Api call

As explained in ASP.NET Core in Action, 3e

An HTTP request is a client-to-server message specifying an operation on a resource and optionally carrying headers and a body.

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.
CH01_F02_Lock3

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.
CH01_F03_Lock3

Trace how an ASP.NET Core application receives a request, processes it, and returns a response through its web server. section 1.4.2

How ASP.NET Core in Action, 3e covers it

How deep it goes
Defines request components and follows processing through Kestrel and HttpContext, but defers detailed response-generation components.
Examples
Uses browser navigation to a home page and server-generated HTML as the concrete request-response example.
What it assumes
Assumes only a client-server interaction and introduces HTTP request-response behavior from basic web navigation.
What you can do after
Evaluate a request's verb, path, headers, body, response status, and server-side processing path.
How it connects
Connects HTTP requests with HTTP responses, web servers, ASP.NET Core, Kestrel, and HttpContext.

Also explained in

Compare how 3 books explain api call →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ASP.NET Core in Action, 3e. The section links point to the parts of the book it draws on.