我尝试从ionic-storage获取auth-token并使用该令牌进行post请求,但HTTP post没有返回任何内容
这是我的实现
GET_Communities() {
return(this.storage.ready().then(
() => {
this.storage.get(TOKEN_KEY).then(
(token) => {
console.log(token);
return(this.http.post('https://example.com/api/communities', JSON.stringify(token)).pipe(
) );
}
);
}```发布于 2019-06-27 00:43:27
我不知道你用来做http的插件是什么,但你应该试试这个本机插件:
import { HTTP } from '@ionic-native/http';而不是
import { HTTP } from '@angular/common/http';如果你用的是最后一个
在ionic 4中,您必须执行以下操作:
import { http } from '@ionic-native/http';
this.http.post('https://example.com/api/communities', JSON.stringify(token)', {})
.pipe(
)https://stackoverflow.com/questions/56775345
复制相似问题