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

My Code:

from odoo import http
from odoo.http import request

class CustomController(http.Controller):

​@http.route("/test/validate", type="json", auth="public", website=False, methods["POST"])​
​def custom_api(self):
​body = {'decision': 'reject'}
​return request.make_json_response(body)

Output:

{
​"jsonrpc": "2.0",
​"id": null,
​"result": ""
}


I need to only send the raw JSON response and not the RPC response.

{
​'decision': 'reject'
}

How to do this?

อวตาร
ละทิ้ง
ผู้เขียน

Response:
{
"jsonrpc": "2.0",
"id": null,
"result": "<Response 22 bytes [200 OK]>"
}

ผู้เขียน คำตอบที่ดีที่สุด

Response Got: { "jsonrpc": "2.0", "id": null, "result": ""}

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.ค. 23
6459
0
พ.ย. 22
2572
0
ธ.ค. 24
1160
0
ม.ค. 23
2261
2
เม.ย. 22
10688