2
http://localhost:9000/api/res.users?sudo=1&filter=[["id","=",11]]&query={id,name,image_128,phone}

how to compose above url with axios and send it to server.

i tried params but i think i'm missing something because i'm getting

     Promise {
  "_U": 0,
  "_V": 0,
  "_W": null,
  "_X": null,
}

my code looks like thisthis was when i tried using apisauce

now using axios i tried this way

const res = axios.get('http://localhost:9000/api/res.users', {
        params:{
            sudo: '1',
            filter: '[["id", "=", 11]]',
            query: "{phone,name}"
        }
    });
    console.log("res", res);
  • You are logging an unresolved promise, please see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function for async operations. – Hassan Kandil Jan 25 '22 at 09:38

1 Answers1

1

Try this it will work

axios.get('http://localhost:9000/api/res.users', {
    params:{
        sudo: '1',
        filter: '[["id", "=", 11]]',
        query: "{phone,name}"
    }
}).then(res=>{
   console.log("res", res);
});
hassanqshi
  • 353
  • 2
  • 9