Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1030 Näkymät

If you want to fetch from a URL but don't know how to add a header or any other information, this guide will help you.


Odoo http service didn't provide a way to put header in http.get method. ref : https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch




But after reading the code in odoo, I can say that you can use fetch 


const options = {

            headers: {

                "Content-Type": "application/json",

            };,

        };

const response = await fetch(fullUrl, options)


For more information : https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch


I'm using Odoo 16, but I think it should also work in Odoo 14+.


*Odoo please fix bug where I put /code in question description. It disappear when I post it

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
heinäk. 25
261
0
kesäk. 25
485
1
kesäk. 25
711
1
kesäk. 25
735
1
toukok. 25
1286