On Tue, Jan 26, 2010 at 6:33 AM, J. Shirley <jshir...@gmail.com> wrote:

>
>
> I'm all for reusable code, but in no way should HTTP::Body start
> taking this behavior by default.  I'm not really that sure how
> effective it is, anyway.
>

No, I was not suggesting that would be the default (although I'm not sure
why not handling other serializations by default is a bad idea).  Not sure
what you mean by "effective".


> decode_json( $c->req->body ); Is just not that hard :)
>

Of course it's not that hard.  Of course, this isn't hard, either:  [1]

map { s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; $_ } split /[&;=]/,
$c->req->body;

I see those as similar operations.  The request is serialized in both cases.

But, one should not have to worry about adding low-level details like that
to application code when using an elegant web framework. ;)


No big deal.  I was just curious why the HTTP::Body approach was not used in
the existing REST/RPC modules, as that was already the place used by
Catalyst to de-serialize the body.  I thought maybe there was a reason I
might not understood, which is why I asked.

[1] Or whatever the correct approach is, and apologies to Damian for the
map.

-- 
Bill Moseley
mose...@hank.org
_______________________________________________
List: Catalyst@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/

Reply via email to