const myHeaders = new Headers(); myHeaders.append("X-API-KEY", "YOUR_API_KEY"); myHeaders.append("Content-Type", "application/json"); const raw = JSON.stringify({ "inputs": { "calculationMethod": "Design", "selectedFluidSide1": { "fluidId": 53, "isGas": false, "inputValue": null }, "selectedFluidSide2": { "fluidId": 53, "isGas": false, "inputValue": null }, "coCurrent": false, "selectedHeatExchangers": [ { "heatExchangerInputType": "Parent", "id": 1 } ], "heatLoad": { "amount": 1500, "unit": "HeatLoadUnit.Kilowatt" }, "inletTemperatureSide1": { "amount": 80, "unit": "TemperatureUnit.DegreeCelsius" }, "inletTemperatureSide2": { "amount": 20, "unit": "TemperatureUnit.DegreeCelsius" }, "outletTemperatureSide1": { "amount": 40, "unit": "TemperatureUnit.DegreeCelsius" }, "outletTemperatureSide2": { "amount": 50, "unit": "TemperatureUnit.DegreeCelsius" }, "flowSide1": null, "flowSide2": null, "maxPressureDropSide1": { "amount": 20000, "unit": "PressureUnit.Pascal" }, "maxPressureDropSide2": { "amount": 20000, "unit": "PressureUnit.Pascal" }, "numberOfPasses": null, "numberOfPlates": null, "numberOfPlatesStack1": null, "numberOfPlatesStack2": null, "oversurface": null, "portSwitch": true, "autoperformance": false } }); const requestOptions = { method: "POST", headers: myHeaders, body: raw, redirect: "follow" }; fetch("https://api.swep.net/calculateSinglePhase", requestOptions) .then((response) => response.text()) .then((result) => console.log(result)) .catch((error) => console.error(error));