我一直在我的整个项目中使用 Alamofire。现在在我的一个模块中,Alamofire.request() 没有被执行。我尝试放置一个断点,它显示突然请求被跳过。由于我正在为安全目的进行实时项目,因此不包括 URL。我使用的代码在这里给出。
func responseFunction() {
let url = ""
let parametervalue = ["enq_id" : self.enquiry_id]
print(self.enquiry_id)
Alamofire.request(url, method: .post, parameters: parametervalue).responseJSON(completionHandler: {response in
if let response_data = response.result.value as? NSDictionary{
let rdata = response_data.value(forKey: "response") as! String
if rdata == "Success"
{
let res_data = response_data.value(forKey: "result") as! [NSDictionary]
print(res_data)
for resultdata in res_data{
let enqid = resultdata.value(forKey: "enq_id") as! String
let userid = resultdata.value(forKey: "user_id") as! String
let reference_no = resultdata.value(forKey: "reference_no") as! String
let enq_date = resultdata.value(forKey: "enq_date") as! String
let enq_time1 = resultdata.value(forKey: "enq_time") as! String
let enq_time2 = enq_time1.replacingOccurrences(of: "+", with: " ")
let enq_time = enq_time2.replacingOccurrences(of: "%3A", with: " : ")
}
self.queryResponseTable.reloadData()
}
else{
let alertController = UIAlertController(title: "Response Details", message: "Server Error ! Could not get any response. Please try again later!", preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "Dismiss", style: .default))
self.present(alertController, animated: true, completion: nil)
}
}
})
}
谁能帮我吗?