News for hackers. Stuff that matters.
Re:A few tips for Web API design by mseebach on Wednesday December 22, 2010 @09:18AM (#2031349)
I think you mean XML instead of SOAP. A JSON version of a SOAP service would be a completely different API.

Except for consuming the API directly in a browser, there's little reason that XML should cause you pain.

Re:A few tips for Web API design by mccutchen on Wednesday December 22, 2010 @11:06AM (#2031597)
> Except for consuming the API directly in a browser, there's little reason that XML should cause you pain.

I disagree. Unless the data I'm working with are awkward/difficult to represent in JSON (ie, they're highly structured documents, for which XML is ideal), XML is always more painful to work with. More painful to produce and to consume.

This is working primarily with Python and Javascript.

Re:A few tips for Web API design by jbrennan on Wednesday December 22, 2010 @12:08PM (#2031734)
I can echo this for working on iOS with Cocoa touch as well. While there's no native JSON provided by Cocoa touch, there are excellent third-party tools.

XML in iOS is a beast, and a real pain to read (and I've never attempted to write it).

Plus, on mobile devices especially, XML is slower to download because it is more verbose than the equivalent JSON object.

So I agree, unless you need a highly structured document, I always go with JSON over XML.

Re:A few tips for Web API design by ZoFreX on Wednesday December 22, 2010 @09:23AM (#2031362)
The only applications I've made that interface with JSON or XML APIs were in Java, and JSON was less headache every time. GSON makes it trivial to marshall/unmarshall, and I haven't found an equivalent XML library - not for lack of trying!
Re:A few tips for Web API design by phpnode on Wednesday December 22, 2010 @11:23AM (#2031631)
not really, JSON makes it easy to exchange standard objects and arrays between languages, in PHP it's as simple as: $json = json_encode($object); $object = json_decode($json); I'm sure it's equally easy in other languages, XML is not good in this use case. There's no standard way to do it.