コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
24052 ビュー
i want to make rest api using json i use this code for authentication from odoo import http
from odoo.http import request
class SalesCustome(http.Controller):
@http.route ('/session/authentication',type = 'json', auth = 'none', method = ['POST'], csrf = False)
def authentication(self, db, username, password, base_location=None):
request.session.authentication[db, username, password]
return request.env['ir.http'].session_info ()
but when test rest api using postman the result is 404 Not Found and this error is displayed "Traceback (most recent call last):\n  File \"C:\\Program Files (x86)\\Odoo 13.0e\\server\\odoo\\http.py\", line 619, in _handle_exception\n    return super(JsonRequest, self)._handle_exception(exception)\n  File \"C:\\Program Files (x86)\\Odoo 13.0e\\server\\odoo\\http.py\", line 309, in _handle_exception\n    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])\n  File \"C:\\Program Files (x86)\\Odoo 13.0e\\server\\odoo\\tools\\pycompat.py\", line 14, in reraise\n    raise value\n  File \"C:\\Program Files (x86)\\Odoo 13.0e\\server\\odoo\\http.py\", line 1422, in _dispatch_nodb\n    func, arguments = self.nodb_routing_map.bind_to_environ(request.httprequest.environ).match()\n  File \"C:\\Program Files (x86)\\Odoo 13.0e\\python\\lib\\site-packages\\werkzeug\\routing.py\", line 1581, in match\n    raise NotFound()\nwerkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again.\n",

アバター
破棄
著作者 最善の回答

Thanks

@Manish Kumar Bohra  but i use odoo 13 i check this video but the same error 
アバター
破棄
最善の回答

Hello,

Please check the video related to API

https://www.youtube.com/watch?v=wGvuRbCyytk&vl=en

Thanks.

アバター
破棄
関連投稿 返信 ビュー 活動
4
5月 24
12605
1
4月 24
3244
0
11月 23
1986
1
9月 23
2073
2
8月 23
4463