How does a server detect a request made with the fetch API?
<p>I have an ASP.NET MVC 5 Application, which handles requests from my web site made with the fetch API.
When an exception occurred in my controller, I use my custom "OnException" method, overriden from System.Web.Mvc.Controller, to send a result in JSON, containing data about the error. I do this because I don't want to send the default HTML error page.
In this method, which is global for all controllers, I need to check if the request has been performed with the fetch API (if not, I don't do anything).</p>

<p>How can I do this ?</p>

<ul>
<li>Should I add a custom http header to my requests ? </li>
<li>Should I add a specific parameter in all my requests ?</li>
<li>Do I have a totally wrong approach ?</li>
</ul>