Dotnet Minimal Api Denemeleri

app.MapGet("api/getAnil",()=>
{
Human human=new Human("anil",88,"Computer Engineer");
return human;
}
);
//That's so Node.js
app.MapGet("/parametredeneme",(int id,string onemli)=>
{
return id+" onemli: "+onemli;
}
);
//https://localhost:7125/parametredeneme?id=44&onemli=deneme
app.MapPost("/postDeneme",(Human human)=>
{
return human;
}
);
//curl -H "Content-Type: application/json" -X POST -d '{"name":"bir","Age":2,"Profession":"Sociologist"}' https://localhost:7125/postDeneme/
app.MapGet("/Model",null); app.MapGet("/Model/{id}",null); app.MapPost("/Model",null); app.MapPut("/Model/{id}",null); app.MapDelete("/Model/{id}",null);
app.MapGet("/badrequest",()=>{ return Results.BadRequest("Problems"); });
app.MapGet("/birdiger/{id}",(int id)=>{
return Results.Ok(id);
}
);
//https://localhost:7125/birdiger/1446544

--

--

--

Computer Engineer,Sociologist, CSE Master Student

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
anıl kaynar

anıl kaynar

Computer Engineer,Sociologist, CSE Master Student

More from Medium

Create a web API using minimal API ASP.NET Core

View Components in ASP.NET Core

Wpf.Extensions.Hosting for running WPF on Generic Hosts has been released.

JWT Authentication In .NET Core Web API Project