BREAKING CHANGE:
This change moves the http module into angular2/, so its import
path is now angular2/http instead of http/http.
Many other modules have also been moved around inside of angular2,
but the public API paths have not changed as of this commit.
- Extends URLSearchParams API to include operations for combining
different URLSearchParams objects:
These new methods include:
setAll(otherParams): performs `this.set(key, values[0])` for each
key/value-list pair in `otherParams`
appendAll(otherParams): performs `this.append(key, values)` for
each key/value-list pair in `otherParams`
replaceAll(otherParams): for each key/value-list pair in
`otherParams`, replaces current set of values for `key` with
a copy of the list of values.
- RequestOptions do not merge search params automatically (because
there are multiple ways to do this). Instead, they replace any
existing `search` field if `search` is provided. Explicit merging
is required if merging is desirable.
- Some extra test coverage added.
Closes#2417Closes#3020
BREAKING CHANGE:
The Http module previously would return RxJS Observables from method calls
of the Http class. In order to support Dart, the module was refactored to
return the EventEmitter abstraction instead, which does not contain the same
combinators or subscription semantics as an RxJS Observable. However, the
EventEmitter provides a toRx() method which will return an RxJS Subject,
providing the same subscription and combinator conveniences as were
available prior to this refactor.
This is temporary, until issue #2794 is resolved, when Observables will
again be returned directly from Http class methods.
The BaseRequestOptions class is responsible for declaring default values,
while the RequestOptions class is merely responsible for setting values
based on values provided in the constructor.
BREAKING CHANGE: HttpFactory is no longer available.
This factory provided a function alternative to the `request` method of the
Http class, but added no real value. The additional factory required an
additional IHttp interface, an odd way to inject while preserving type information
(`@Inject(HttpFactory) http:IHttp`), and required additional documentation in the
http module.
Closes#2564
This implementation only works in JavaScript, while the Observable transpilation
story gets worked out. Right now, the service just makes a simple request,
and returns an Observable of Response.
Additional functionality will be captured in separate issues.
Fixes#2028