Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
8445 มุมมอง

UPDATE: TO Admins, can you please close or delete post.

the problem description was wrong. 

my problem is now sorted but it wasn't the one i described below


Hello, 


I working on the app which tries to login to my odoo backend on different hosting.

but when i try to login, I receive error : CORS preflight response did not succeed). Status code: 400.


my request contains following:

  method: "POST",
headers: { "Content-Type": "application/json",
"Accept": "application/json",
"Access-Control-Allow-Origin": this.#origin },
data: {
'jsonrpc':"2.0",
'params':
{
'db': this.#db,
'login':username,
'password':password,
},
},
withCredentials: true,
crossDomain: true,
baseURL: this.#base_url,
url: "/web/session/authenticate"


but because of CORS policy, browser sends  another OPTIONS request to server with content-type text/html; charset=utf-8 therefore I receive an error:

/web/session/authenticate: Function declared as capable of handling request of type 'json' but called with a request of type 'http'


anybody know how to overcome this problem?


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ค. 23
2606
0
พ.ค. 22
2766
0
เม.ย. 17
3187
0
มี.ค. 15
13040
0
มี.ค. 15
6810