Function declared as capable of handling request of type 'json' but called with a request of type 'http'

I had tried an Ionic v4 and tried to communicate with odoo server v10. So i had used an advanced http plugin. and make a request to server like this.

home.page.ts

this.http
    .post(
      "http://10.42.0.63:8877/web/database/list",
      {
        jsonrpc: "2.0",
        method: "call",
        id: 1,
        csrf_token: "CSRF_TOKEN",
        params: {}
      },
      {
        "Content-Type": "application/json; charset=utf-8",
        "x-csrf-token": "CSRF_TOKEN"
      }
    )
    .then((res: any) => {
      console.log("---------------res--------------" + JSON.stringify(res));
    })
    .catch((err: any) => {
      console.log("---------------err--------------" + JSON.stringify(err));
    });

I had faced the error like this.

<function list at 0x7f99c50005f0>, /web/database/list: Function declared as capable of handling request of type 'json' but called with a request of type 'http'

I googled everything about it but can’t find expected result. Please guide me how to solve this. Thanks in advance.

1 Like

I’m getting the same error. This works fine in debug mode for me but release build throws this error.