Tuesday, August 2, 2016

ResponseType attribute in ASP.NET Web API

I was recently introduced to the ResponseType attribute for documenting my ASP.NET Web API Web Applications.  This was a feature that I was not aware of previously and after discovering it, found rather handy!

If you read the MSDN documentation for this attribute, you will see that it is used to describe the Web API for Web API Help: https://msdn.microsoft.com/en-us/library/system.web.http.description.responsetypeattribute(v=vs.118).aspx

This article addresses the ResponseType attribute as well as other Data Annotations much more clearly: http://www.strathweb.com/2014/01/return-types-action-parameters-and-data-annotations-now-available-in-web-api-2-1-help-page/

Therefore, you can use all of these attributes to more clearly your Web API Urls!

No comments:

Post a Comment