How to use the wpcom-xhr-request.get function in wpcom-xhr-request

To help you get started, we’ve selected a few wpcom-xhr-request examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Automattic / wpcom.js / app.js View on Github external
Me.prototype.get = function (query, fn) {
  return request.get(this.wpcom, null, '/me', query, fn);
};
github Automattic / wpcom.js / app.js View on Github external
Me.prototype.connections = function (query, fn) {
  return request.get(this.wpcom, null, '/me/connections', query, fn);
};
github Automattic / wpcom.js / app.js View on Github external
Site.prototype.renderEmbed = function (embed, query, fn) {
  if ('string' !== typeof embed) {
    throw new TypeError('expected an embed String');
  }

  var path = '/sites/' + this._id + '/embeds/render';
  return request.get(this.wpcom, { embed_url: embed }, path, query, fn);
};
github Automattic / wpcom.js / app.js View on Github external
Media.prototype.get = function (query, fn) {
  var path = '/sites/' + this._sid + '/media/' + this._id;
  return request.get(this.wpcom, def, path, query, fn);
};
github Automattic / wpcom.js / app.js View on Github external
Site.prototype.get = function (query, fn) {
  return request.get(this.wpcom, null, '/sites/' + this._id, query, fn);
};
github Automattic / wpcom.js / app.js View on Github external
Comment.prototype.get = function (query, fn) {
  var path = '/sites/' + this._sid + '/comments/' + this._cid;
  return request.get(this.wpcom, null, path, query, fn);
};
github Automattic / wpcom.js / app.js View on Github external
Users.prototype.suggest = function (query, fn) {
  return request.get(this.wpcom, null, '/users/suggest', query, fn);
};
github Automattic / wpcom.js / app.js View on Github external
Me.prototype.sites = function (query, fn) {
  return request.get(this.wpcom, null, '/me/sites', query, fn);
};
github Automattic / wpcom.js / app.js View on Github external
Me.prototype.likes = function (query, fn) {
  return request.get(this.wpcom, null, '/me/likes', query, fn);
};
github Automattic / wpcom.js / app.js View on Github external
Me.prototype.groups = function (query, fn) {
  return request.get(this.wpcom, null, '/me/groups', query, fn);
};

wpcom-xhr-request

REST API requests to WordPress.com via XMLHttpRequest (and CORS)

MIT
Latest version published 3 years ago

Package Health Score

49 / 100
Full package analysis