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
13202 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
4078
1
sie 20
17716
0
kwi 17
3386
0
wrz 24
1567
2
sie 23
4587