@feliperiverot wrote:
I am working with Ionic 4 developing and hybrid app. I am trying to consume an API URL. I am calling the API with the below code.
import { HttpHeaders, HttpErrorResponse, HttpClient } from '@angular/common/http'; constructor(private http: HttpClient, private androidPermissions: AndroidPermissions, private uid: Uid, private device: Device, public platform: Platform, public formBuilder: FormBuilder, private router: Router, private nativeStorage: NativeStorage,private fb: Facebook, private googlePlus:GooglePlus ) { platform.ready().then(() => { this.onDeviceReady(); }); } let urlSearchParams = new URLSearchParams(); urlSearchParams.append('brand', this.myManufacturer ); urlSearchParams.append('model', this.myModel); urlSearchParams.append('androidid', this.myUuidt); urlSearchParams.append('serialsim', this.myUuidt); urlSearchParams.append('imei', this.myIMEI); this.httpOptions = { headers: new HttpHeaders( { 'Content-Type': 'application/json', 'Authorization': this.tobas64string }) } this.http.post("some url", urlSearchParams.toString(), this.httpOptions).subscribe( data => { alert(JSON.stringify(data)); }, error => { alert(JSON.stringify(error)); } );
And I get this result:
I am testing in my cell phone, is android 9 model.
Any ideas why this is happening?
Posts: 1
Participants: 1