Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

$http doesn't cache without specifying method- 'GET' #5985

Closed
dzdrazil opened this issue Jan 25, 2014 · 1 comment
Closed

$http doesn't cache without specifying method- 'GET' #5985

dzdrazil opened this issue Jan 25, 2014 · 1 comment

Comments

@dzdrazil
Copy link

I'm not sure if this should be a documentation or code fix, but the problem is fairly simple- it's line 933 of https://github.com/angular/angular.js/blob/master/src/ng/http.js:

By default, $http({...options...}) will issue GET requests. However, the requests are not cached (even when specifying a cache option) UNLESS the method: 'GET' key/value are included in the options passed to $http- it's not mixed into the configuration as a default value.

Should $http throw an exception without a specified method, or should ALL $http behavior work by assuming the method is GET unless otherwise specified?

I'm open to taking a stab at a pull request, but it'll be a few days and I wanted to get this in while I had time.

@caitp
Copy link
Contributor

caitp commented Jan 25, 2014

I think if we are issuing the request as a GET request (and it's not the browser deciding to do that on its own) then this is a bug to be fixed, and most likely a trivial one to correct.

You should have a go at it, it might get merged

pkozlowski-opensource added a commit to pkozlowski-opensource/angular.js that referenced this issue Feb 21, 2014
pkozlowski-opensource added a commit to pkozlowski-opensource/angular.js that referenced this issue Feb 21, 2014
pkozlowski-opensource added a commit to pkozlowski-opensource/angular.js that referenced this issue Feb 21, 2014
pkozlowski-opensource added a commit to pkozlowski-opensource/angular.js that referenced this issue Feb 21, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants