Subject: | is_xhr method |
I want to add method is_xhr to Catalyst::Request.
Here is a code:
sub is_xhr {
my $self = shift;
my $req_with = $self->header('X-Requested-With');
return 1 if defined $req_with and $req_with eq 'XMLHttpRequest';
}
It is commonly used by AJAX application, if you need to support users
without JavaScript.
This method exists in ruby on rails, and it is cool :-)