[Catalyst] Re: Converting a GET request to a POST request
Sam Kaufman
samuel.c.kaufman at gmail.com
Mon Nov 22 22:21:45 GMT 2010
package Resty::Controller::API;
use Moose;
use namespace::autoclean;
BEGIN { extends 'Catalyst::Controller::REST' }
use JSON;
__PACKAGE__->config(
'stash_key' =3D> 'rest',
'map' =3D> { '*/*' =3D> 'JSONP', },
);
sub foo : Local : ActionClass('REST') {
}
sub foo_GET {
my ( $self, $c ) =3D @_;
my $obj =3D decode_json($c->req->params->{body});
$self->status_ok( $c, entity =3D> $obj );
}
1;
<script src=3D'http://foo.com/api/foo?callback=3Dhey&body=3D{"foo":1}'></sc=
ript>
On Mon, Nov 22, 2010 at 3:18 PM, Adam Sj=F8gren <asjo at koldfront.dk> wrote:
> On Mon, 22 Nov 2010 21:12:26 +0100, Aristotle wrote:
>
> > * Ronald J Kimball <rkimball at pangeamedia.com> [2010-11-22 18:50]:
>
> >> I want to convert a GET request to a POST request, inside my
> >> Catalyst app, before dispatching happens.
> [...]
>
> > This is really, really, really bad.
> [...]
>
> So, what solution do you recommend instead?
>
>
> Best regards,
>
> Adam
>
> --
> "Boy, I love summer vacation. Adam Sj=F8g=
ren
> I can feel my brain beginning to atrophy already." asjo at koldfront.dk
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101122/709ce=
ef2/attachment.htm
More information about the Catalyst
mailing list