跳至內容
選單
此問題已被標幟
1 回覆
1374 瀏覽次數

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": ""}

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
7月 23
6452
0
11月 22
2569
0
12月 24
1156
0
1月 23
2252
2
4月 22
10684