Return JSON with error status code MVC

前端 未结 11 1665
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 13:23

I was trying to return an error to the call to the controller as advised in This link so that client can take appropriate action. The controller is called by javascript via

11条回答
  •  有刺的猬
    2020-11-27 13:43

    There is a very elegant solution to this problem, just configure your site via web.config:

    
        
    
    

    Source: https://serverfault.com/questions/123729/iis-is-overriding-my-response-content-if-i-manually-set-the-response-statuscode

提交回复
热议问题