Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
1250 Zobrazení

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?

Avatar
Zrušit
Autor

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

Autor Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
čvc 23
6256
0
lis 22
2466
0
pro 24
1046
0
led 23
2171
2
dub 22
10490