title: How to know if function is accessed from a form or api call
body: <p>I'm using an MVC framework. I have a URL like example.com/submit which displays a form that submits to itself, but I also want it to support programmatic submission (like an API). How can I find out if the url is being called by someone who typed the url and filled out the form and submitted it, or by someone who is doing it programatically with the api? Is there something in the headers or any other way to get a clue?</p>