[wp-meta] [Making WordPress.org] #1522: Add `Access-Control-Allow-Origin` header to api.wordpress.org

Making WordPress.org noreply at wordpress.org
Sun Jan 17 14:04:28 UTC 2016


#1522: Add `Access-Control-Allow-Origin` header to api.wordpress.org
--------------------------+-------------------------------
  Reporter:  DvanKooten   |      Owner:
      Type:  enhancement  |     Status:  closed
  Priority:  normal       |  Component:  api.wordpress.org
Resolution:  worksforme   |   Keywords:
--------------------------+-------------------------------
Changes (by Otto42):

 * status:  new => closed
 * resolution:   => worksforme


Comment:

 Generally speaking, we'd prefer that you did not make client side requests
 to the API server. Those servers get a lot of traffic and adding more is
 not something we wish to support at this time.

 For those cases where we do allow the data to be used client side, we have
 added JSONP support, which will allow you to make such a request from the
 browser without having to adjust the headers or running into cross-domain
 restrictions.

 For example, the PHP version numbers are available using JSONP like so:

 https://api.wordpress.org/stats/php/1.0/?callback=example

 With jQuery, getting this data would look like so:

 {{{
 jQuery.getJSON('//api.wordpress.org/stats/php/1.0/?callback=?', function
 (data) {
         // data contains the data
 });
 }}}

--
Ticket URL: <https://meta.trac.wordpress.org/ticket/1522#comment:1>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list