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
11766 Widoki
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?

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

Did you find any solution to return status code?

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
lip 21
3531
1
sie 20
17143
0
kwi 17
2999
0
wrz 24
1048
2
sie 23
3952