I'm using the rest api odoo server to get content data of a model. I tested on Postman, it works well,
but when I integrated into the client side (React app), the request returned an error
Plz help me solve this problem, maybe the way to add headers at client side is wrong, I handle at front end like this
setAuthorization(token) {
this.httpClient.defaults.headers.common["access_token"] = token;
}
I've fixed it by the way that I allowed method OPTIONS access into the server to check. Go to main.py from restful module to change it
@http.route(_routes, type="http", auth="none", methods=["GET", "OPTIONS"], csrf=False, cors='*')