Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added json method to services #73

Merged
merged 1 commit into from

3 participants

@dashersw

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

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

    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
View
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.