Skip to content

Commit

Permalink
Fixes #584 and make the post/get/put/delete methods behave the same a…
Browse files Browse the repository at this point in the history
…s send
  • Loading branch information
Arian committed May 30, 2010
1 parent 12d3c7d commit e77483e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Request/Request.js
Expand Up @@ -194,8 +194,8 @@ var Request = new Class({

var methods = {};
['get', 'post', 'put', 'delete', 'GET', 'POST', 'PUT', 'DELETE'].each(function(method){
methods[method] = function(){
var params = Array.link(arguments, {url: Type.isString, data: function(obj){ return (obj != null);}});
methods[method] = function(params){
if(typeOf(params) == 'string') params = {data: params};
return this.send(Object.append(params, {method: method}));
};
});
Expand Down

0 comments on commit e77483e

Please sign in to comment.