Commit graph

20 commits

Author SHA1 Message Date
Igor Minar
16a40c626f style(*): small fixes 2012-01-13 14:28:21 -08:00
Igor Minar
b7f4d8c3c3 fix($http): anonnymous response interceptors should be treated as factories 2012-01-13 14:28:20 -08:00
Igor Minar
46691c2721 fix($http): remove support for PATCH + better whenXXX, expectXXX api
- there are too many unknowns about PATCH, so I'm dropping its support until we know that this is actually useful
- expectGET, expectHEAD and expectJSON (and the same for whenXXX) should not require response data to be specified
2012-01-13 13:53:07 -08:00
Misko Hevery
d648d709f3 refactor(module): strict separation between module-config / app-runtime 2012-01-12 13:40:07 -08:00
Igor Minar
23f8da7cbb feat($http): expose req/resp headers to transform fns 2012-01-09 13:17:48 -08:00
Igor Minar
a13b5ed3bc fix($http): fix and cleanup $http and friends
$http:
- use promises internally
- get rid of XhrFuture that was previously used internally
- get rid of $browser.defer calls for async stuff (serving from cache),
  promises will take care of asynchronicity
- fix transformation bugs (when caching requested + multiple request
  pending + error is returned)
- get rid of native header parsing and instead just lazily parse the
  header string

$httpBackend:
- don't return raw/mock XMLHttpRequest object (we don't use it for
  anything anymore)
- call the callback with response headers string

mock $httpBackend:
- unify response api for expect and when
- call the callback with response headers string
- changed the expect/when failure error message so that EXPECTED and GOT
  values are aligned

Conflicts:

	src/service/http.js
	test/service/compilerSpec.js
	test/service/httpSpec.js
2012-01-09 13:17:48 -08:00
Igor Minar
163e05ed36 feat($http): allow interceptors to be services 2011-12-05 23:53:26 -08:00
Igor Minar
188bdf7768 feat($http): add response interceptors 2011-11-30 14:49:35 -05:00
Igor Minar
dbd880cc0a feat($http): add promise support
quite messy, some tests are missing, contains an experimental jasmine DI support)
2011-11-30 14:49:35 -05:00
Vojta Jina
92995bbce9 fix($http): default json transformation should not crash on angular template
The way we determine whether it's json is lame anyway. We need to change that.
We should probably check the content type header...
2011-11-30 11:17:25 -05:00
Vojta Jina
b9707d910e style(): get rid off some jsl warnings 2011-11-30 11:17:25 -05:00
Vojta Jina
5bbd64ac65 feat($http): allow passing custom cache instance per request
You can still use cache: true, which will use $http's default cache.
2011-11-30 11:17:25 -05:00
Vojta Jina
6290bd4587 refactor(mock.$httpBackend): rename when().then() to when().respond() 2011-11-30 11:17:24 -05:00
Vojta Jina
afbe073121 feat(mock.$httpBackend): add verifyNoOutstandingRequest method
+ rename verifyExpectations to verifyNoOutstandingExpectation
2011-11-30 11:17:23 -05:00
Vojta Jina
7b705df2b7 feat($http): broadcast $http.request event 2011-11-30 11:17:23 -05:00
Vojta Jina
972c3e9be0 refactor($http): change callback matching mechanism 2011-11-30 11:17:22 -05:00
Vojta Jina
fe633dd0cf fix($http): allow multiple json vulnerability prefixes
We strip out both:
)]}',
)]}'
2011-11-30 11:17:22 -05:00
Vojta Jina
fdcc2dbfd3 feat($http): expose pendingRequests and configuration object
- $http.pendingRequests is now an array of pending requests
- each request (its future object) has public property configuration
2011-11-30 11:17:22 -05:00
Vojta Jina
cd28a2e952 feat(mocks.$httpBackend): add $httpBackend mock
$httpBackend mock allows:
- expecting (asserting) requests
- stubbing (responding without asserting)

Add empty $httpBackend service (currently just wrapper for $browser.xhr)
2011-11-30 11:12:14 -05:00
Vojta Jina
59adadca08 feat($http): new $http service, removing $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 get parameters: response, status, headers
Closes #38
Closes #80
Closes #180
Closes #299
Closes #342
Closes #395
Closes #413
Closes #414
Closes #507
2011-11-30 11:12:14 -05:00