noodlehaus/dispatch — pull request #50 by scan (2014-06-09 07:10:33+00:00)
Title: Add an utility to check for Ajax-Requests

This change adds a tiny function `is_xhr` which checks the headers of the request for `X-Requested-With`, containing `XMLHttpRequest`, which is usually set by browsers when using the `XMLHttpRequest` object. I have found this function useful when writing up an API. Perhaps it's a good idea to add it for others, too.