Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Added json method to services #73

merged 1 commit into from

3 participants

Armagan Amcalar KAZUYUKI TANIMURA Dan Webb
Armagan Amcalar

json method saves the user from setting options on a regular request as

{ data: JSON.stringify(data} }
Dan Webb danwrong merged commit 14a06a5 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 23, 2012
  1. Armagan Amcalar

    Made rest.json method available to services, so that users can easily…

    dashersw authored
    … call it with any REST method.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  lib/restler.js
3  lib/restler.js
@@ -450,6 +450,9 @@ mixin(Service.prototype, {
post: function(path, options) {
return post(this._url(path), this._withDefaults(options));
+ json: function(method, path, data, options) {
+ return json(this._url(path), data, this._withDefaults(options), method);
+ },
del: function(path, options) {
return del(this._url(path), this._withDefaults(options));
Something went wrong with that request. Please try again.