in reply to Which format is best to consume from a webservice?

I guess it's a hot topic, you'll find (possibly strong) opinions on both sides.

I think I'd go for the smallest format which preserves all needed information (as long as it doesn't bring other headaches with it).

That's probably YAML, but maybe JSON. (Although the "just eval it" approach to JSON does give me the shivers. Do people really do that in AJAX? Or do they do the parse in javascript code too?)

  • Comment on Re: Which format is best to consume from a webservice?

Replies are listed 'Best First'.
Re^2: Which format is best to consume from a webservice?
by Joost (Canon) on Aug 14, 2007 at 12:26 UTC
    ... the "just eval it" approach to JSON does give me the shivers. Do people really do that in AJAX?

    For the most part: yes they do. Two reasons:

    1. it's by far the fastest way to "parse" complex data structures in javascript (though eval()ing very large strings in IE is still slow).

    2. you'll only receive the data from your own server anyway (can't access any other server via XMLHTTP), so you can already make sure the data is in the desired format on the server side.