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
13642 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
4300
1
sie 20
17978
0
kwi 17
3575
0
wrz 24
1723
2
sie 23
4844