diff --git a/src/ng/http.js b/src/ng/http.js index 57dc71721d10..5ddee858b26b 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -847,7 +847,7 @@ function $HttpProvider() { * @param {Object=} config Optional configuration object * @returns {HttpPromise} Future object */ - createShortMethods('get', 'delete', 'head', 'jsonp'); + createShortMethods('get', 'delete', 'head', 'jsonp', 'patch'); /** * @ngdoc method diff --git a/test/ng/httpSpec.js b/test/ng/httpSpec.js index a0417d9ad99c..0289721d3137 100644 --- a/test/ng/httpSpec.js +++ b/test/ng/httpSpec.js @@ -873,6 +873,15 @@ describe('$http', function() { $http.head('/url', {headers: {'Custom': 'Header'}}); }); + it('should have patch()', function() { + $httpBackend.expect('PATCH', '/url').respond(''); + $http.patch('/url'); + }); + + it('patch() should allow config param', function() { + $httpBackend.expect('PATCH', '/url', undefined, checkHeader('Custom', 'Header')).respond(''); + $http.patch('/url', {headers: {'Custom': 'Header'}}); + }); it('should have post()', function() { $httpBackend.expect('POST', '/url', 'some-data').respond('');