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
13117 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
4026
1
sie 20
17671
0
kwi 17
3350
0
wrz 24
1521
2
sie 23
4533