I have an ASP.NET MVC site and ELMAH is showing me that my site is erroring when receiving an HTTP request with REQUEST_METHOD = HEAD.
How do I respond to these requests using ASP.NET MVC?
Use the [AcceptVerbs( HttpVerbs.Head )]
attribute to mark the method as responding to a HEAD request. You can add more potential methods by OR'ing the verbs together so it can respond to multiple request verbs. I suspect your method is already marked with the attribute as I think it should respond to any request verb if you don't have any restrictions. On a side note, I think it would be pretty rare to get a HEAD request, care to elaborate on why and how you're receiving it?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With