Swift 3.0和Alomofire 4发布请求返回date =“空请求”

时间:2017-05-29 07:34:15

标签: swift3 alamofire

我是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的截图,它返回了一些有效的数据:

enter image description here

0 个答案:

没有答案