我是Swift 3.0的新手,下面是我试图制作的帖子
let newParams: Parameters = ["p_data": ["sync": sync,"data": data,"cmd" : "getEventList"]]
Alamofire.request(AppLocalSettings.baseURL, method: .post, parameters: newParams, encoding: JSONEncoding.default, headers: nil).validate().responseJSON { response in
print(response.request as Any)
print(response.response as Any)
print(response.result.value as Any)
}
我得到的状态代码是200,响应是:
Optional({
data = "Empty Request";
status = 0;
})
此帖子请求的网址为“http://sircleschoolps.myauschools.com.au/webservices_v4”。下面给出了postman的截图,它返回了一些有效的数据: