تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
11554 أدوات العرض
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

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
يوليو 21
3456
1
أغسطس 20
17047
0
أبريل 17
2946
0
سبتمبر 24
976
2
أغسطس 23
3843