Alamofire数据请求

时间:2022-01-09 16:31:47
        let stringurl = "http://www.huiyunche.cn/kyleuat/banner/list"
Alamofire.request(.GET,stringurl,parameters:nil)
.responseJSON { response in
if let JSON = response.result.value {
var dic1 = NSMutableDictionary()
dic1 = (JSON as? NSMutableDictionary)!
print("postJSON: \(dic1["data"]![0])")
}
}
        let stringurl = "http://www.huiyunche.cn/kyleuat/order/republish"
let para=["orderid": "","reason":"reason"];
Alamofire.request(.POST,stringurl,parameters:para,headers:headers)
.responseJSON { response in
//print(response.request) // original URL request
//print(response.response) // URL response
//print(response.data) // server data
//print(response.result) // result of response serialization if let JSON = response.result.value {
print("postJSON: \(JSON)")
}
}