NAME
Catalyst::Model::REST - REST model class for Catalyst
VERSION
version 0.15
SYNOPSIS
# model
__PACKAGE__->config(
server => 'http://localhost:3000',
type => 'application/json',
);
# controller
sub foo : Local {
my ($self, $c) = @_;
my $res = $c->model('MyData')->post('foo/bar/baz', {foo => 'bar'});
my $code = $res->code;
my $data = $res->data;
...
}
DESCRIPTION
This model class makes REST connectivety easy.
NAME
Catalyst::Model::REST - REST model class for Catalyst
METHODS
new
Called from Catalyst.
method methods
Catalyst::Model::REST accepts the standard HTTP 1.1 methods
post
get
put
delete
options
All methods take these parameters
url - The REST service
data - The data structure (hashref, arrayref) to send
AUTHOR
Kaare Rasmussen, <kaare at cpan dot com>
BUGS
Please report any bugs or feature requests to bug-catalyst-model-rest at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Catalyst-Model-REST.
COPYRIGHT & LICENSE
Copyright 2010 Kaare Rasmussen, all rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
AUTHOR
Kaare Rasmussen <kaare at cpan dot net>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Kaare Rasmussen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.