diff --git a/apps/tests/http-tests.ts b/apps/tests/http-tests.ts index 53a3711d8..a3c0dd905 100644 --- a/apps/tests/http-tests.ts +++ b/apps/tests/http-tests.ts @@ -364,6 +364,9 @@ export var test_request_NonStringHeadersSentAndReceivedProperly = function (done }; export var test_request_jsonAsContentSentAndReceivedProperly = function (done) { + // + // ### Post JSON + // ``` JavaScript var result; http.request({ @@ -371,17 +374,27 @@ export var test_request_jsonAsContentSentAndReceivedProperly = function (done) { headers: { "Content-Type": "application/json" }, content: JSON.stringify({ MyVariableOne: "ValueOne", MyVariableTwo: "ValueTwo" }) }).then(function (response) { + // result = response.content.toJSON(); + // result = response.content.toJSON(); - try { + try + { TKUnit.assert(result["json"]["MyVariableOne"] === "ValueOne" && result["json"]["MyVariableTwo"] === "ValueTwo", "Content not sent/received properly!"); done(null); } catch (err) { done(err); } + // + // console.log(result); }, function (e) { + // done(e); + // + // console.log("Error occurred " + e); }); + // ``` + // }; export var test_getString_FromVariousUrls_ShouldWorkProperly = function (done) { @@ -554,4 +567,4 @@ export var test_XMLHttpRequest_requestShouldBePossibleAfterAbort = function (don xhr.abort(); xhr.send(JSON.stringify({ MyVariableOne: "ValueOne", MyVariableTwo: "ValueTwo" })); -}; \ No newline at end of file +};