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

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

Thanks

@Manish Kumar Bohra  but i use odoo 13 i check this video but the same error 
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello,

Please check the video related to API

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

Thanks.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 5 24
12622
1
thg 4 24
3265
0
thg 11 23
2010
1
thg 9 23
2099
2
thg 8 23
4484