У меня несколько запросов http.post в проекте IONIC 3. Мне нужно сохранить состояние сеанса между вызовами. Я звоню на сервер следующим образом:
this.http.post('http://192.168.1.107:7777/mobile/Open_a').
subscribe(
(data:any) =>
{
// first processing data for the first call here.
// next calling the server for the second time and passing the data back to the server
// start of second call
this.http.post('http://192.168.1.107:7777/mobile/Open_b',
{params: {clientdata:"test data"}}).
subscribe((data2:any)=>
{
console.log(data2);
},
err2 =>
{
console.log('error happened!');
console.log(err2.message);
let alert = this.alertCtrl.create({
title: 'Connection error',
subTitle: err2.message,
buttons: ['Dismiss']
});
alert.present();
}
);
// end of second call code},
err =>
{
console.log('error happened!');
console.log(err.message);
ProductDataProvider.ItemsLoaded=true;
ProductDataProvider.IsLoading=false;
let alert = this.alertCtrl.create({
title: 'Connection error',
subTitle: err.message,
buttons: ['Dismiss']
});
alert.present();
}
);
проблема в том, что оба вызова к серверу работают, но состояние сеанса не сохраняется. Кто-нибудь может указать, что я делаю неправильно?
Любой совет высоко ценится.
твой искренне