Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
1245 Vistas

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
Descartar
Autor

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

Autor Mejor respuesta

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

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
jul 23
6253
0
nov 22
2466
0
dic 24
1044
0
ene 23
2171
2
abr 22
10489