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
12018 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
3719
1
sie 20
17335
0
kwi 17
3104
0
wrz 24
1199
2
sie 23
4142