[Catalyst] How to de-serialize json?
J. Shirley
jshirley at gmail.com
Thu Jan 28 00:37:40 GMT 2010
On Wed, Jan 27, 2010 at 4:14 PM, Bill Moseley <moseley at hank.org> wrote:
> I see. So you are saying that Content-Type: application/json might need to
> be deserialized differently in different applications that share the same
> interpreter? Obviously, json could decode into an array ref so that could
> not be mapped to request parameters. Is that what you mean? Or that an
> application might want the raw json?
>
I actually have two applications that expect and need the raw data,
rather than the serialized response.
In one case, it's a simple relay mechanism (unreliable system POSTs
JSON feed, and reliable system then rebroadcasts it) similar to a
pubsub model. It is much faster to just relay the data rather than
deserialize.
Another case, storing the data in something like MogileFS. I don't
necessarily want to deserialize it but I do need the mime-type from
the uploads. I tend to be the type that store data as I receive it,
then clean it separately as needed.
Half-way contrived examples, but based off of real world stuff I have
done/am doing.
-J
More information about the Catalyst
mailing list