-
Notifications
You must be signed in to change notification settings - Fork 20
Returning Responses #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Returning responses from minimal APIsMinimal APIs takes care of setting content types from common response formats. For example, an endpoint that returns a text payload will automatically encode the response with the app.MapGet("/", () => "Hello World!");
Objects returns from an endpoint are automatically encoced as a JSON response object. var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/", () => new ToDo(1, "Take out the trash!"));
app.Run();
record ToDo(int Id, string Task);
Returning
|
No description provided.
The text was updated successfully, but these errors were encountered: