Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
11943 Lượt xem
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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

Did you find any solution to return status code?

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 7 21
3656
1
thg 8 20
17257
0
thg 4 17
3036
0
thg 9 24
1127
2
thg 8 23
4062