cordova-plugin-advanced-http

Ionic 4 native http POST with multiple headers

廉价感情. 提交于 2019-12-10 11:46:03
问题 Here is how I am doing an http post from my Ionic app: import { HTTP } from '@ionic-native/http/ngx'; someAction(assetId: number, userId: number) { var asset: Asset = new Asset(); asset.assetId = assetId.toString(); asset.userId = userId.toString(); const options = { headers: "Content-Type: application/json; charset=utf-8" }; return this.http.post(this.url + "someAction", asset, options).then(data => { return "Done"; }).catch(err => { console.log(err); }); } According to the documentation