Showing posts with label json. Show all posts
Showing posts with label json. Show all posts

Monday, December 15, 2008

JSON in ColdFusion

Pretty excited these days about JSON... I've used it sporadically in many applications, but every month there appears to be new uses for it. I particularly enjoyed one use where we stored some interface preferences as a small JSON cookie. I also LOVE being able to call a CF webservice and auto-magically return JSON (covered in depth at Ben Nadel's blog here: JSON part II) - it's saved us a couple times.

Anyways, I saw a blog post today about the release of JSONUtil - very cool. It's a nice way to serialize and deserialize JSON in CF 7, and is based on CFJSON code.

In my main contract, we've been arguing a bit about returning JSON in the header vs. in the body. We are leaning heavily towards starting to return JSON in the response body, but we're a bit worried about the META tag that CF returns when working in development mode.

Here's some good reading about JSON and Prototype from Frank Tank. He argues nicely for putting JSON in the response body.

T