Respond to HTTP HEAD requests using ASP.NET MVC

后端 未结 2 1213
花落未央
花落未央 2020-12-17 08:12

I\'d like to correctly support the HTTP HEAD request when bots hit my ASP.NET MVC site using HEAD. It was brought to my attention that all HTTP HEAD requests to the site wer

2条回答
  •  太阳男子
    2020-12-17 09:09

    You can achieve the result by simply doing following

    [AcceptVerbs(HttpVerbs.Get | HttpVerbs.Head)]
    public ActionResult TestMe() =>View();
    

提交回复
热议问题