[wp-trac] [WordPress Trac] #14618: Proposal: Standardize WP Responses to JS Requests as JSON

WordPress Trac wp-trac at lists.automattic.com
Tue Oct 26 01:43:24 UTC 2010


#14618: Proposal: Standardize WP Responses to JS Requests as JSON
-------------------------+--------------------------------------------------
 Reporter:  filosofo     |       Owner:                
     Type:  enhancement  |      Status:  new           
 Priority:  normal       |   Milestone:  Future Release
Component:  JavaScript   |     Version:  3.0           
 Severity:  normal       |    Keywords:  needs-patch   
-------------------------+--------------------------------------------------

Comment(by josephscott):

 Replying to [comment:17 filosofo]:
 >
 > True XHR uploads are very fringe.  They're not going to be supported
 across enough browsers any time in the near future and aren't being used
 in current WP.
 >
 > > Also, any generalized API like the one proposed will not be limited to
 just XHR use.
 >
 > True.  But whatever is going to make use of the API in this future state
 will have more choices under my proposal; it won't be harmed by it.

 You asked for an example, I provided one.  JSON-RPC will suffer from the
 same problem XML-RPC does in this area.


 > > True, I should have been more specific, I was thinking of per method
 versions.
 >
 > Which can be solved the same way.  That seems to be how many popular web
 APIs handle such things; take a look for example at the Google Maps and
 MailChimp API versioning.

 I scanned through the docs for both of these, I didn't see JSON-RPC listed
 as an option for either one.  Quite the opposite, they use more standard
 direct HTTP APIs, as I suggested in my first comment.


 > > I don't see that any of these reasons require an RPC approach.
 >
 > You're right that they don't ''require'' this ''specific'' approach.
 However, they do require ''some'' sort of standardization as opposed to
 the current eclecticism.  JSON RPC has the advantage of being an already-
 existing standard, widening support and familiarity throughout the web dev
 world, being easy to use in JS, among other things.

 Perhaps I stopped following the development of JSON-RPC too soon then.  I
 hadn't seen much uptake in JSON-RPC, though I might not be looking in the
 right places.

 > However, I'm reasonably certain another communication standard could
 work almost as well.  My point is pushing to a decent standard, not
 finding the absolutely perfect one.  Do you have an alternative in mind?

 As I suggested in my first comment on this ticket, my suggest is to use a
 simple direct HTTP based API.  Not an RPC based API.

 The Twitter and Facebook Graph APIs are popular examples of what I'm
 suggesting.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14618#comment:20>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list