import requests import json url = "https://api.swep.net/calculateSinglePhase" payload = json.dumps({ "inputs": { "calculationMethod": "Design", "selectedFluidSide1": { "fluidId": 53, "isGas": False, "inputValue": None }, "selectedFluidSide2": { "fluidId": 53, "isGas": False, "inputValue": None }, "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": None, "flowSide2": None, "maxPressureDropSide1": { "amount": 20000, "unit": "PressureUnit.Pascal" }, "maxPressureDropSide2": { "amount": 20000, "unit": "PressureUnit.Pascal" }, "numberOfPasses": None, "numberOfPlates": None, "numberOfPlatesStack1": None, "numberOfPlatesStack2": None, "oversurface": None, "portSwitch": True, "autoperformance": False } }) headers = { 'X-API-KEY': '2b26ba08333ea08a5763a81ccd993213082bda45fdebba1240b270e24e29834058433a880ed1f9a5dcebc4f40f2f698a', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)