Permalink
Browse files

feat(common): accept object map for HttpClient headers & params (#18490)

Today, constructing a new GET request with headers looks like:

const headers = new HttpHeaders({
  'My-Header': 'header value',
});
http.get('/url', {headers}).subscribe(...);

This indirection is unnecessary. It'd be more ergonomic to write:

http.get('/url', {headers: {'My-Header': 'header value'}}).subscribe(...);

This commit allows that new syntax, both for HttpHeaders and HttpParams.
In the HttpParams case it also allows construction of HttpParams with a map.

PR Close #18490
  • Loading branch information...
alxhub authored and jasonaden committed Aug 1, 2017
1 parent 65e26d7 commit 1b1d5f10a19adcd1e4c157f3295d70ec7919861a
Oops, something went wrong.

0 comments on commit 1b1d5f1

Please sign in to comment.