MapGet and MapPost
noun
say it: “MAP-get and MAP-pohst” /ˈmæpɡɛt ænd ˈmæppoʊst/
Minimal API methods that connect an HTTP method and an address to the function that handles it.
What is MapGet and MapPost?
MapGet, MapPost, MapPut, MapPatch and MapDelete connect an HTTP method and a URL pattern to the code that handles it.
app.MapGet("/recipes", (IRecipeRepository r) => r.ListAsync());
app.MapPost("/recipes", (NewRecipe body, IRecipeRepository r) => r.AddAsync(body));
In a sentence
- “MapGet("/products", ...) answers every GET to /products.”
Level: Apprentice · More ASP.NET Core terms at this level
Updated