{"ScriptPreparationCode":null,"TestCases":[{"Name":"jQuery test case","Code":"$.ajax({\r\n type: \u0027POST\u0027,\r\n url: \u0022http://vanilla-js.com/path/to/api\u0022,\r\n data: {\u0027banana\u0027: \u0027yellow\u0027},\r\n success: (data) = {},\r\n});","IsDeferred":false},{"Name":"Vanilla JS test case","Code":"const sendAjax = (url, data, callback) =\u003E {\r\n fetch(url, {\r\n method: \u0027POST\u0027,\r\n body: new URLSearchParams(data),\r\n }).then((response) =\u003E {\r\n \tconst contentType = response.headers.get(\u0022content-type\u0022);\r\n if (contentType \u0026\u0026 contentType.indexOf(\u0022application/json\u0022) !== -1) {\r\n return response.json().then(data =\u003E {callback(data)});\r\n } else {\r\n return response.text().then(text =\u003E {callback(text)});\r\n }\r\n });\r\n}\r\n\r\nsendAjax(\u0027http://vanilla-js.com/path/to/api\u0027, {\u0027banana\u0027: \u0027yellow\u0027}, (data) =\u003E {});","IsDeferred":false}]}