Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
11927 Prikazi
from odoo.http import Response, Controller


class Example(Controller):
     @http.route("/example/", methods=["POST"], type="json", auth="public", csrf=False)
     def example(self):
         return Response("Testing 403", status=403)


Above code seems to return code 200, how can I specify return code?

Avatar
Opusti
Best Answer

Hi,

Did you find any solution to return status code?

It return my given status code in the response json not in the request

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
0
jul. 21
3623
1
avg. 20
17244
0
apr. 17
3028
0
sep. 24
1110
2
avg. 23
4040