[eluser]Aken[/eluser]
is_ajax_request() is built into the Input class already.
An ajax request and a POST request are two different things. You can have a POST request without an ajax request (standard form submission), or you can have both, or you can have an ajax request without POST data. How you check depends completely on what you're trying to accomplish.
And like that StackOverflow answer mentions, I don't separate ajax requests - I check for an ajax request on an existing method, and act accordingly.