Skip to content

Commit

Permalink
Merge: Added the PATCH and HEAD methods to Request
Browse files Browse the repository at this point in the history
* pr/2610:
  Typo
  Doc
  Added the PATCH and HEAD methods
  • Loading branch information
SergioCrisostomo committed Jun 30, 2014
2 parents 8a3d562 + 829c06f commit 2c72ef2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Docs/Request/Request.md
Expand Up @@ -289,6 +289,8 @@ These aliases are:
- `get()` and `GET()`
- `put()` and `PUT()`
- `delete()` and `DELETE()`
- `patch()` and `PATCH()`
- `head()` and `HEAD()`

### Syntax:

Expand Down Expand Up @@ -322,7 +324,7 @@ These aliases are:

### Note:

By default the emulation option is set to true, so the *put* and *delete* send methods are emulated and will actually send as *post* while the method name is sent as e.g. `_method=delete`.
By default the emulation option is set to true, so the *put*, *delete* and *patch* send methods are emulated and will actually send as *post* while the method name is sent as e.g. `_method=delete`.

`Async` and `timeout` options are mutually exclusive. If you set `async` to `false`, then there's no need to set the `timeout` since the server and browser will set their own timeouts to return executing the rest of your script.

Expand Down
2 changes: 1 addition & 1 deletion Source/Request/Request.js
Expand Up @@ -232,7 +232,7 @@ var Request = this.Request = new Class({
});

var methods = {};
['get', 'post', 'put', 'delete', 'GET', 'POST', 'PUT', 'DELETE'].each(function(method){
['get', 'post', 'put', 'delete', 'patch', 'head', 'GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD'].each(function(method){
methods[method] = function(data){
var object = {
method: method
Expand Down

0 comments on commit 2c72ef2

Please sign in to comment.