I would construct the below payload dynamically for a POST service call. I am not sure how to create a list of strings in dictionary
{
"Id":"2025",
"deviceType": "iphone",
"category": ["Dental", "Vision"]
}
My code
var categoryList = ["Dental", "Vision"]
let json = ["Id": "2025", "deviceType": "iphone", "category": categoryList] as! Dictionary<String, String>
let jsonData = try? JSONSerialization.data(withJSONObject: json)