#
# REST.pm
-# Created by: Adam Jacob, Marchex, <adam@marchex.com>
+# Created by: Adam Jacob, Marchex, <adam@hjksolutions.com>
# Created on: 10/13/2006 03:54:33 PM PDT
#
# $Id: $
use strict;
use warnings;
-use base 'Catalyst::Request';
+use base qw/Catalyst::Request Class::Accessor::Fast/;
use HTTP::Headers::Util qw(split_header_words);
=head1 SYNOPSIS
- if ( $c->request->accepts('text/x-json') ) {
+ if ( $c->request->accepts('application/json') ) {
...
}
=head1 METHODS
-=over 4 data
-
If the request went through the Deserializer action, this method will
returned the deserialized data structure.
__PACKAGE__->mk_accessors(qw(data accept_only));
+=over 4
+
=item accepted_content_types
Returns an array reference of content types accepted by the
if $self->content_type;
if ($self->method eq "GET" && $self->param('content-type')) {
-
$types{ $self->param('content-type') } = 2;
}
return grep { $_ eq $type } @{ $self->accepted_content_types };
}
+=back
+
=head1 AUTHOR
Adam Jacob <adam@stalecoffee.org>, with lots of help from mst and jrockway
+=head1 MAINTAINER
+
+J. Shirley <jshirley@cpan.org>
+
=head1 LICENSE
You may distribute this code under the same terms as Perl itself.