Skip to content

Commit 6bf18db

Browse files
author
Denis Rechkunov
committed
Merge branch 'release/1.1.0'
2 parents 4b39b3d + 5d970df commit 6bf18db

2 files changed

Lines changed: 26 additions & 7 deletions

File tree

lib/UHRBase.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,14 @@ var ERROR_UNSUPPORTED_PROTOCOL = 'Protocol is unsupported',
4444

4545
UHRBase.METHODS = {
4646
GET: 'GET',
47+
HEAD: 'HEAD',
4748
POST: 'POST',
4849
PUT: 'PUT',
49-
DELETE: 'DELETE'
50+
PATCH: 'PATCH',
51+
DELETE: 'DELETE',
52+
OPTIONS: 'OPTIONS',
53+
TRACE: 'TRACE',
54+
CONNECT: 'CONNECT'
5055
};
5156

5257
UHRBase.TYPES = {
@@ -128,6 +133,20 @@ UHRBase.prototype.put = function (url, options, callback) {
128133
this.request(parameters, callback);
129134
};
130135

136+
/**
137+
* Does PATCH request to HTTP server.
138+
* @param {string} url URL to request.
139+
* @param {Object} options Object with options.
140+
* @param {Function<Error, Object, string>?} callback Callback on finish
141+
* with error, status object and data.
142+
*/
143+
UHRBase.prototype.patch = function (url, options, callback) {
144+
var parameters = Object.create(options);
145+
parameters.method = UHRBase.METHODS.PATCH;
146+
parameters.url = url;
147+
this.request(parameters, callback);
148+
};
149+
131150
/**
132151
* Does DELETE request to HTTP server.
133152
* @param {string} url URL to request.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "catberry-uhr",
3-
"version": "1.0.4",
3+
"version": "1.1.0",
44
"author": "Denis Rechkunov <denis.rechkunov@gmail.com>",
55
"description": "Universal HTTP(S) Request module for catberry framework",
66
"homepage": "https://github.com/catberry/catberry-uhr",
@@ -17,18 +17,18 @@
1717
},
1818
"main": "./index.js",
1919
"devDependencies": {
20-
"catberry-locator": "~0.4.0",
21-
"mocha": "~1.19.0",
22-
"jscs": "~1.4.5",
23-
"jshint": "~2.5.0"
20+
"catberry-locator": "^1.0.0",
21+
"mocha": "^1.20.0",
22+
"jscs": "~1.4.0",
23+
"jshint": "^2.5.0"
2424
},
2525

2626
"engines": {
2727
"node": "~0.10.26"
2828
},
2929

3030
"scripts": {
31-
"test": "jshint ./ && jscs ./** && mocha --recursive"
31+
"test": "jshint ./ && jscs ./ && mocha --recursive"
3232
},
3333

3434
"licenses": [

0 commit comments

Comments
 (0)