liveBook · Manning

HTTP GET

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

GET is an HTTP method for retrieving a resource from a server.

GET retrieves a resource from a server. Browsers use it when you enter a URL or follow a link, and an application can map a GET request to an endpoint that returns a response. section 3.6 section 5.2.2

A minimal GET endpoint

app.MapGet("/", () => "Hello World!"); This endpoint responds with plain text when a client sends a GET request to the root path. The server begins listening after app.Run(). section 3.6

Use GET for retrieval and keep state-changing operations on methods with different semantics:

  • Fetch data only; do not use GET to send data or modify server state. section 5.2.2
  • Use POST to create or send data, PUT to create or replace, PATCH to modify, and DELETE to remove a resource. section 5.2.2

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

How deep it goes
Defines retrieval semantics and demonstrates endpoint mapping, stopping short of HTTP protocol internals.
Examples
Uses a root Hello World endpoint and a parameterized person route.
What you can do after
Apply GET via MapGet to return data without changing server state.
How it connects
Connects HTTP verbs with endpoints, minimal APIs, URL paths, POST, PUT, PATCH, and DELETE.

Also explained in

Compare how 14 books explain HTTP GET →

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.