Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
1294 Widoki

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?

Awatar
Odrzuć
Autor

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

Autor Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lip 23
6337
0
lis 22
2499
0
gru 24
1079
0
sty 23
2197
2
kwi 22
10559