feat(Headers): implement `toJSON`
This commit is contained in:
parent
2ca5e38a78
commit
0cb32c2fef
|
@ -1,4 +1,11 @@
|
||||||
import {isPresent, isBlank, isJsObject, isType, StringWrapper} from 'angular2/src/facade/lang';
|
import {
|
||||||
|
isPresent,
|
||||||
|
isBlank,
|
||||||
|
isJsObject,
|
||||||
|
isType,
|
||||||
|
StringWrapper,
|
||||||
|
Json
|
||||||
|
} from 'angular2/src/facade/lang';
|
||||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
||||||
import {
|
import {
|
||||||
isListLikeIterable,
|
isListLikeIterable,
|
||||||
|
@ -120,6 +127,11 @@ export class Headers {
|
||||||
*/
|
*/
|
||||||
values(): string[][] { return MapWrapper.values(this._headersMap); }
|
values(): string[][] { return MapWrapper.values(this._headersMap); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns string of all headers.
|
||||||
|
*/
|
||||||
|
toJSON(): string { return Json.stringify(this.values()); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns list of header values for a given name.
|
* Returns list of header values for a given name.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue