Using:
let data = try! post.jsonData()
let dict = try! JSONSerialization.jsonObject(with: data, options: []) as! [String:Any]
(force unwrapping for the sake of simplicity)
I receive this:
{
"message" : "Some message",
"media" : [
{
"type" : "jpeg",
"url" : "storage\/thumb_QEHzApawkkMq3N2IYFhwLRUxhHlJd3rJK1NyCqvB.jpeg"
}
]
}
instead of this ( note the backslash for the media.url )
{
"message" : "Some message",
"media" : [
{
"type" : "jpeg",
"url" : "storage/thumb_QEHzApawkkMq3N2IYFhwLRUxhHlJd3rJK1NyCqvB.jpeg"
}
]
}
I expect to get the JSON formatted the way the object is, without that annoying backslash as the API will not accept it,
What can it be?