【发布时间】:2018-11-28 03:48:59
【问题描述】:
我遇到了一些问题。 POST 不向服务器发送数据。 GET 工作正常。以下是我的代码:-
post(user){
let bodynow = {
"email_id": "aa@gmsd.sdf",
"mobile":"9978897989",
"first_name": "dfdf",
"last_name": "ghgfh",
"user_title":"MS",
"country_code": "91"
}
const url =
"https://www.allevoyage.com/index.php/hotels_android/update_profile";
this.http.setDataSerializer("json");
this.http
.post(url, bodynow,headers)
.then(data => {
console.log(data,data.url);
})
.catch(err => {
console.log(err);
});
}
以下是版本:
cordova-plugin-advanced-http 版本:-2.0.1
ionic-native/http 版本:-4.17.0
“cordova-ios”:“4.5.5”
当我使用邮递员时,我得到了正确的输出,但是当我使用离子原生 http 时,它没有向服务器发送数据并且我得到状态 200,结果用户不存在。
有人可以帮我解决我哪里出错了
【问题讨论】:
标签: cordova ionic-framework ionic-native