diff --git a/lib/http.js b/lib/http.js index 9c8e4de..5a7c5e5 100644 --- a/lib/http.js +++ b/lib/http.js @@ -544,19 +544,6 @@ var HTTPObject = function(engine) { return this; }; - this.post = function(url, callback, onError) { - try { - if (this.jqEnabled()) { - this.setMethod("POST"); - this.jqAjax(url, callback, onError); - } else { - return this.open("POST", url).send(callback); - } - } catch (e) { - if (typeof onError === "function") onError(this, null, e); - } - }; - this.get = function(url, callback, onError) { try { if (this.jqEnabled()) { @@ -570,6 +557,19 @@ var HTTPObject = function(engine) { } }; + this.post = function(url, callback, onError) { + try { + if (this.jqEnabled()) { + this.setMethod("POST"); + this.jqAjax(url, callback, onError); + } else { + return this.open("POST", url).send(callback); + } + } catch (e) { + if (typeof onError === "function") onError(this, null, e); + } + }; + this.patch = function(url, callback, onError) { try { if (this.jqEnabled()) { @@ -583,6 +583,32 @@ var HTTPObject = function(engine) { } }; + this.put = function(url, callback, onError) { + try { + if (this.jqEnabled()) { + this.setMethod("PUT"); + this.jqAjax(url, callback, onError); + } else { + return this.open("PUT", url).send(callback); + } + } catch (e) { + if (typeof onError === "function") onError(this, null, e); + } + }; + + this.delete = function(url, callback, onError) { + try { + if (this.jqEnabled()) { + this.setMethod("DELETE"); + this.jqAjax(url, callback, onError); + } else { + return this.open("DELETE", url).send(callback); + } + } catch (e) { + if (typeof onError === "function") onError(this, null, e); + } + }; + this.pushState = function(state, title, url) { this.states.push({ "state": state,