Converting ecobee Alamofire request to use URLSession
问题 As a followup to my last question (Alamofire syntax for ecobee request), I would prefer to just use URLSession for the request. Now I'm back to a request that times out with status 408 using the following code: guard let url = URL(string: "https://api.ecobee.com/1/thermostat") else { return } let jsonParameters = [ "selection": [ "selectionType": "registered", "selectionMatch": "" ] ] let jsonData = try! JSONEncoder().encode(jsonParameters) let jsonString = String(decoding: jsonData, as: UTF8