Skip to content

Commit 0cb32c2

Browse files
PatrickJSvsavkin
authored andcommitted
feat(Headers): implement toJSON
1 parent 2ca5e38 commit 0cb32c2

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

modules/angular2/src/http/headers.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import {isPresent, isBlank, isJsObject, isType, StringWrapper} from 'angular2/src/facade/lang';
1+
import {
2+
isPresent,
3+
isBlank,
4+
isJsObject,
5+
isType,
6+
StringWrapper,
7+
Json
8+
} from 'angular2/src/facade/lang';
29
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
310
import {
411
isListLikeIterable,
@@ -120,6 +127,11 @@ export class Headers {
120127
*/
121128
values(): string[][] { return MapWrapper.values(this._headersMap); }
122129

130+
/**
131+
* Returns string of all headers.
132+
*/
133+
toJSON(): string { return Json.stringify(this.values()); }
134+
123135
/**
124136
* Returns list of header values for a given name.
125137
*/

0 commit comments

Comments
 (0)