Mustafa Lokhandwala
Mustafa Lokhandwala

Reputation: 814

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

I had tried an Ionic v4 angular and tried to communicate with odoo 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.

Upvotes: 1

Views: 1094

Answers (0)

Related Questions