http://localhost:9000/api/res.users?sudo=1&filter=[["id","=",11]]&query={id,name,image_128,phone}
如何用 axios 撰寫上面的 url 并將其發送到服務器。
我嘗試了引數,但我認為我錯過了一些東西,因為我得到了
Promise {
"_U": 0,
"_V": 0,
"_W": null,
"_X": null,
}
我的代碼看起來像這樣這是我嘗試使用 apisauce 的時候
現在使用 axios 我嘗試過這種方式
const res = axios.get('http://localhost:9000/api/res.users', {
params:{
sudo: '1',
filter: '[["id", "=", 11]]',
query: "{phone,name}"
}
});
console.log("res", res);
uj5u.com熱心網友回復:
試試這個它會作業
axios.get('http://localhost:9000/api/res.users', {
params:{
sudo: '1',
filter: '[["id", "=", 11]]',
query: "{phone,name}"
}
}).then(res=>{
console.log("res", res);
});
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/421075.html
標籤:
