default encoding is now querystring instead of JSON

This commit is contained in:
Florent Vilmart
2016-03-08 08:08:48 -05:00
parent 6acb5cee80
commit bd7d951ad6
2 changed files with 8 additions and 12 deletions

View File

@@ -161,13 +161,13 @@ describe("httpRequest", () => {
})
});
it("should encode a JSON body by default", (done) => {
it("should encode a query string body by default", (done) => {
let options = {
body: {"foo": "bar"},
}
let result = httpRequest.encodeBody(options);
expect(result.body).toEqual('{"foo":"bar"}');
expect(result.headers['Content-Type']).toEqual('application/json');
expect(result.body).toEqual('foo=bar');
expect(result.headers['Content-Type']).toEqual('application/x-www-form-urlencoded');
done();
})