.NET Tips and Tricks

Blog archive

Returning Status Codes from ASP.NET Core Controllers

Short, short tip: If you're working in an ASP.NET Core controller you may not have noticed that you have some new methods for generating a response to go back to the client: Ok, Created, NotFound and others. Each of these methods returns a standard HTTP status code. All these methods accept parameters that also let you pass in some content to be formatted into your return message's body.

Saying "Everything went swell" or "Sorry about that" has never been easier.

Posted by Peter Vogel on 10/26/2018 at 1:31 PM


Featured

  • Stone Steps Graphic

    Microsoft Research's SandDance Data Visualization Tool Goes Open Source

    A data visualization tool some four years in the making from Microsoft Research has been open sourced, available for use as an extension for Visual Studio Code or Azure Data Studio.

  • Writing the Code for a gRPC Service and Client in ASP.NET Core 3.0

    Once you've got a contract that describes a gRPC service, creating the service itself and a client that can call the service is easy. In fact, Visual Studio will do most of the work for you ... once you've got your projects set up correctly, that is.

  • Microsoft Doubles Down on Instructional Videos: Xamarin and Python

    After Microsoft's Scott Hanselman introduced a bunch of new beginner-level instructional videos for .NET, Xamarin guru James Montemagno wanted to remind mobile developers that similar resources are available for them.

.NET Insight

Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.

Upcoming Events