Heterogeneous collection literal could only be inferred to '[String : Any]'; add explicit type annotation if this is intentional
If the type could not be inferred you have to annotate
let body : [String:Any] = ["id": userID, "name": userName, "contactInfo": contactInfo, "message": message]
or bridge cast it:
let body = ["id": userID, "name": userName, "contactInfo": contactInfo, "message": message] as [String:Any]
You should add a [String: Any]
explicit type to the variable.
let body = ["id": userID,
"name": userName,
"contactInfo": contactInfo,
"message": message] as [String: Any]