diff --git a/modules/@angular/http/src/static_request.ts b/modules/@angular/http/src/static_request.ts index c4167dff57..5e305e8fb0 100644 --- a/modules/@angular/http/src/static_request.ts +++ b/modules/@angular/http/src/static_request.ts @@ -128,7 +128,7 @@ export class Request extends Body { getBody(): any { switch (this.contentType) { case ContentType.JSON: - return this.json(); + return this.text(); case ContentType.FORM: return this.text(); case ContentType.FORM_DATA: diff --git a/modules/@angular/http/test/backends/xhr_backend_spec.ts b/modules/@angular/http/test/backends/xhr_backend_spec.ts index 2ae46d62c0..35ed11aba4 100644 --- a/modules/@angular/http/test/backends/xhr_backend_spec.ts +++ b/modules/@angular/http/test/backends/xhr_backend_spec.ts @@ -9,6 +9,7 @@ import {afterEach, beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xit,} from '@angular/core/testing/testing_internal'; import {AsyncTestCompleter, SpyObject} from '@angular/core/testing/testing_internal'; import {BrowserXhr} from '../../src/backends/browser_xhr'; +import {Json} from '../../src/facade/lang'; import {XSRFStrategy} from '../../src/interfaces'; import {XHRConnection, XHRBackend, CookieXSRFStrategy} from '../../src/backends/xhr_backend'; import {provide, Injector, Injectable, ReflectiveInjector} from '@angular/core'; @@ -256,7 +257,7 @@ export function main() { var connection = new XHRConnection( new Request(base.merge(new RequestOptions({body: body}))), new MockBrowserXHR()); connection.response.subscribe(); - expect(sendSpy).toHaveBeenCalledWith(body); + expect(sendSpy).toHaveBeenCalledWith(Json.stringify(body)); expect(setRequestHeaderSpy).toHaveBeenCalledWith('Content-Type', 'application/json'); });