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

httpBulk service #636

Closed
wants to merge 27 commits into from
Closed

httpBulk service #636

wants to merge 27 commits into from

Conversation

IgorMinar
Copy link
Contributor

preliminary version, not to be released with the http branch.

I want to use this only in feedback and if it works well we can consider shipping it with angular or maybe as an extra angular module. (that's why I use angular.forEach instead of forEach, but I made it part of angularFiles so that I can easily run tests).

vojtajina and others added 27 commits October 26, 2011 21:34
Breaks "JSON" xhr method is now called "JSONP"
If jsonp is not successfull, we return internal status -2.
This internal status should by normalized by $xhr into 0,
but $xhr needs to distinguish between jsonp-error/abort/timeout (all status 0).
IE6, IE7 is sync when serving content from cache.
We want consistent api, so we have to use setTimeout to make it async.
Timeouted request responds internal status code -1, which should be normalized
into 0 by $xhr.
Features:
- aborting requests
- more flexible callbacks (per status code)
- custom request headers (per request)
- access to response headers
- custom transform functions (both request, response)
- caching
- shortcut methods (get, head, post, put, delete, patch, jsonp)
- exposing pendingCount()
- setting timeout
Breaks renaming $xhr to $http
Breaks Takes one parameter now - configuration object
Breaks $xhr.cache removed - use configuration cache: true instead
Breaks $xhr.error, $xhr.bulk removed
Breaks Callback functions accepts parameters: response, status, headers
Closes angular#38
Closes angular#80
Closes angular#180
Closes angular#299
Closes angular#342
Closes angular#395
Closes angular#413
Closes angular#414
Closes angular#507
$httpBackend mock allows:
- expecting (asserting) requests
- stubbing (responding without asserting)

Add empty $httpBackend service (currently just wrapper for $browser.xhr)
- remove whole $browser.xhr stuff
- remove whole mock $browser.xhr stuff
- add $httpBackend service + migrate unit tests from $browser
- add temporary API to access $browser's outstandingRequests count
- $http.pendingRequests is now an array of pending requests
- each request (its future object) has public property configuration
Breaks Disabling $resource caching for the moment.
+ rename verifyExpectations to verifyNoOutstandingExpectations
@IgorMinar
Copy link
Contributor Author

I'm killing this PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants