liveBook · Manning

HTTP GET

As explained in Building Web APIs with ASP.NET Core

GET is an HTTP request method for retrieving a resource or representation.

HTTP GET retrieves or reads a resource representation. In REST, it is the request method for obtaining data rather than creating, updating, or deleting it. section 1.1.4

A controller action can accept only GET requests and return the same response as an existing endpoint. Matching CORS and caching settings keeps the new route behavior consistent. section 3.4.3

Configure a GET endpoint by:

  • Mapping the route, such as /v2/CodeOnDemand/Test2. section 3.4.3
  • Restricting the action to the HTTP GET method. section 3.4.3
  • Returning a ContentResult through Content() when the response is text. section 3.4.3
  • Reading an optional integer addMinutes parameter and adding it to server UTC time before sending the response. section 3.4.3

Time-adjusted GET request

A request to /v2/CodeOnDemand/Test2?addMinutes=10 can alter the server-time value shown by the client alert while preserving the endpoint's configured CORS and caching behavior. section 3.4.3

Figure 1.4 HTTP request-response cycle in REST
01-04

Trace how a GET request travels through the REST HTTP request-response cycle. section 1.1.4

How Building Web APIs with ASP.NET Core covers it

How deep it goes
Defines GET and demonstrates route, method, response, query-parameter, CORS, and caching configuration without exploring HTTP internals.
Examples
Demonstrates GET through CodeOnDemand controller routes, ContentResult responses, and an optional addMinutes time adjustment.
What it assumes
Assumes basic web API routing and HTTP awareness while defining GET alongside REST's other standard request methods.
What you can do after
Apply it via a GET-only controller action that returns content and reads an optional integer query parameter.
How it connects
Connects GET with REST, HTTP request-response cycles, query parameters, CORS, caching, and other methods such as POST, PATCH, PUT, 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 Building Web APIs with ASP.NET Core. The section links point to the parts of the book it draws on.