콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
11209 화면

I've used a module who give me a Rest Api, so It works perfectly when I'm using postman but when I using vue it says

 Access to XMLHttpRequest at 'http://localhost:8069/web/session/authenticate' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I want to allow the rest request

아바타
취소
베스트 답변

I have the same problem tried nearly everything. I even tried to use serverside npm odoo-xmlrpc calls. This isn't working at all.
The Vue app is the problem....


To fix this issue build a node app with express that calls the api and then implement that in your vue app.

아바타
취소
베스트 답변

Hi there, 


I also use cors="*" however with authentication it's import to specify the client domain. I am also struggling to get this to work. If you are still working on it, let me know. My email is elin44@gmail.com


Yi

아바타
취소
베스트 답변

Pass cors='*' in your controller method like below


@http.route('/testme', type='http', auth='none', csrf=False, cors='*')
def max_upload_size(self, **kw):
아바타
취소