تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
4590 أدوات العرض

Hello guys;

I am trying to build rest api from controllers I started to test in post man but it gives me 404 error ,but it works in browers here is my sample code:


from odoo import http

class frfr(http.Controller):
@http.route('/hello/',auth='public',type='json',csrf=False,method=['GET'])
def hello(self, **kwargs):
return "hello world"


الصورة الرمزية
إهمال
أفضل إجابة

Hi,

Do you have multiple database's in the odoo instance ? If yes, try by keeping single db and see if it works.

Either you can set db filter or db name in conf file.

Thanks

الصورة الرمزية
إهمال
أفضل إجابة

Hi,
setting db_name in configuration file is working. Strange but working


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
سبتمبر 22
1800
0
يناير 22
465
3
نوفمبر 21
3312
4
ديسمبر 24
17231
1
أكتوبر 21
9094