Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
11744 มุมมอง
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?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Did you find any solution to return status code?

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.ค. 21
3527
1
ส.ค. 20
17134
0
เม.ย. 17
2997
0
ก.ย. 24
1044
2
ส.ค. 23
3944