[wp-hackers] JSON API 1.0 release

Otto otto at ottodestruct.com
Tue Jun 29 19:26:52 UTC 2010


On Tue, Jun 29, 2010 at 2:16 PM, Mike Schinkel
<mikeschinkel at newclarity.net> wrote:
> I'd far prefer to access JSON via REST than XML via RPC; REST and JSON just make things so much easier, at least for me. I also know lots of local programmers here in Atlanta and when discussed most of them agree so I'm not alone.  More importantly, if an API is easier to use it improves adoption for those who are publishing their APIs.  JMTCW

Oh no, not saying it's not easier or better, just that I tend to
prefer existing interfaces rather than rolling my own, probably
incompatible, way of doing things.

BTW, it wouldn't be difficult at all to implement a JSON system using
the built in feeds mechanism. The add_feed function is pretty darned
powerful when you get right down to it.
add_feed('json','custom_json_output') and a rather trivial
custom_json_output function would implement the ability to get any
post or set of posts in a json format quite easily. You could even do
comments through it. You'd have to go another direction for submitting
comments, but frankly you don't necessarily need json to do that when
a standard POST with the comment can work just fine.


More information about the wp-hackers mailing list