Articles in this section
Category / Section

Why should not use Produces attribute in web API controller?

Published:
Updated:

Produces attribute forces all actions within the controller to return JSON-formatted responses. ReportHelper itself will provide the processing data with JSON string. So, there is no need to use produces attribute in Web API controller and actions for converting the JSON also should not be changed for other types.

   public object PostReportAction(Dictionary<string, object> jsonResult)
    {
        return ReportHelper.ProcessReport(jsonResult, this);
    }
Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied