我正在使用离子v1来构建ios应用程序。 每当我发送任何https发布请求时,数据都不会发送,我收到数据为空的错误响应
{
"data": null,
"status": -1,
"config": {
"method": "POST",
"transformRequest": [null],
"transformResponse": [null],
"dataType": "json",
"url": "https://Demo.xxxxxxxxx.com/route1/route2",
"data": {
"user": "Demo"
},
"headers": {
"Accept": "application/json, text/plain, */*",
"Content-Type": "application/json;charset=utf-8"
}
},
"statusText": ""
}
我正在做的http请求是
$http({
method: 'POST',
dataType: 'json',
url: "https://Demo.xxxxxxxxx.com/route1/route2";,
data: {
user: 'demo'
}
})
我将此添加到我的.list文件
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>