Alamofire.request (URL_USER_BY_EMAIL, метод: .get, параметры: nil, кодировка: URLEncoding.httpBody, заголовки: HEADER) .responseJSON {(ответ) в
if let body = response.request?.httpBody, let json = String(data: body, encoding: .utf8) {
print("JSON sent in httpBody: \(json)")
}
if response.result.error == nil {
guard let data = response.data else { return }
let json = try! JSON(data: data)
if let item = json["data"].arrayObject{
for itemset in item{
let dataset = itemset as! [String:AnyObject]
}
}
} else {
completion(false)
debugPrint(response.result.error as Any)
}
}
}