Ionic, 403 Forbidden error

if this.kanallistele() is run else blocks give me 403 forbidden error. if write this.kanalistele() to //HEREEEEEE line dont give me error. how can I solve this problem?

This code run browser but give me 403 forbidden in android

uyegiris()
{
  var veri,kullaniciveri;
  this.deneme=2;
   var headers = new Headers();
    headers.append('Accept', 'application/json');
    headers.append('Content-Type', 'application/json' );
    //headers.append('Authorization' , 'Basic '+ btoa(tok));
    let options = new RequestOptions({ headers: headers });
    
    let postParams = {
      username: this.user['usernameil'],
      password:this.user['password']
    }
    
      this.http.post("https://deneme.com/api/v1.0/users/login/", postParams, options).timeout(2000)
      .subscribe(data => {
        veri = data['_body'];
        veri= veri.slice(1, -1);
        veri = veri.replace(/\\/g, "");
        veri = JSON.parse(veri);
        console.log(veri);
        if(veri.msg_err)
          {
         let alert = this.alertCtrl.create({
         title: 'Giriş Hatası',
         subTitle: veri.msg_err,
         buttons: ['Tamam']
        });
        alert.present();
        }
        else
           { 
            this.kanallistele();
           }
       }, error => {
        console.log(error);
        this.deneme=error;
      });

//HEREEEEEE
}

kanallistele()
{
 var veri;
    this.kanallardiv=true;
    this.uyegirisdiv=false;
    this.kanallistelebtn = false;
    this.kanallistelebtn2 = false;
    var headers = new Headers();
    headers.append('Accept', 'application/json');
    headers.append('Content-Type', 'application/json' );
    //headers.append('Authorization' , 'Basic '+ btoa(tok));
    let options = new RequestOptions({ headers: headers });
    
    let postParams = {
    token: "381f13d7056-ce5fe474919",
    user_id: "71",
    }
    var veris="channel_name_";
    this.http2.post("https://iothook.com/api/v1.0/channels/", postParams, options)
      .subscribe(data => {
        veri = data['_body'];
        console.log(veri);       
        veri= veri.slice(1, -1);
        veri = veri.replace(/\\/g, "");
        veri = JSON.parse(veri);
        for(var i = 0 ;;i++)
          {
              if(!veri.channel_list['channel_name_' + (i)])
                    break;   

              this.veriler.push({channelname: veri.channel_list['channel_name_' + (i)],channelid: veri.channel_list['channel_id_' + (i)]});              
          }
       }, error => {
        console.log(error);
        this.deneme=error;// Error getting the data
      });  
  }

I suspect your proximate problem is likely a CORS issue, but do not access properties of other objects that begin with leading underscores; they are private. Use the public API such as the json() method.

Okey. How can i solved this problem? Dont send me error in browser but send me error in android device and error sending from kanallistele ().

I want to , login and login is succes after get other api values

Did you remote debug the problem on the device already? Follow these instructions here to debug the problem in Chrome dev tools: https://ionic.zone/debug/remote-debug-your-app#android Look at the console and network tabs for errors.

Failed to load resource: the server responded with a status of 403 (Forbidden)

Response
_body: "{“detail”:“CSRF Failed: Referer checking failed - no Referer.”}"
headers: Headers
ok: false
status: 403
statusText: "Forbidden"
type: 2
url: “https://iothook.com/api/v1.0/channels/

The API you are using expects a referer. Try to add one.