代码之家  ›  专栏  ›  技术社区  ›  Arpit todewale

Ionic-500内部服务器错误,如果服务在实际设备中运行。完全在浏览器上运行

  •  0
  • Arpit todewale  · 技术社区  · 6 年前

    我正在使用woo-commerce插件将我的wordpress站点与android应用程序集成。 我正在尝试使用API更新项目的数量。

    当我在浏览器中运行应用程序时,api运行良好。当我在实际设备中运行相同的api时,它会给我500个内部服务器错误。

    其实,跑邮递员也是成功的。

    以下是我要实现的目标的代码:

    let body = {
          cart_item_key: this.getKey,
          quantity: this.updatedQty 
      }
    
    
    
    
    this.http.post(url,body).subscribe((data) => {
          console.log(data.json());
    
         this.toast.show(data.json(), '3000', 'bottom').subscribe(
            toast => {
               console.log(toast);
            }
          );
         },error => {
           console.log(error);
           load.dismiss();
           this.toast.show(error, '3000', 'bottom').subscribe(
            toast => {
               console.log(toast);
            }
          );
      });
    

    我正在附加响应以及从服务器获取的头

    response in postman

    The Related Headers

    这就是我在运行同一个api时在真正的android设备中得到的

    API returns error

    有人能告诉我到底是什么问题吗?

    提前谢谢你。

    0 回复  |  直到 6 年前