diff --git a/modules/angular2/src/http/headers.ts b/modules/angular2/src/http/headers.ts index b6740e642b..e9affb9a0d 100644 --- a/modules/angular2/src/http/headers.ts +++ b/modules/angular2/src/http/headers.ts @@ -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 { isListLikeIterable, @@ -120,6 +127,11 @@ export class Headers { */ 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. */