Skip to Content
Menu
This question has been flagged
2 Replies
22300 Views
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",

Avatar
Discard
Author Best Answer

Thanks

@Manish Kumar Bohra  but i use odoo 13 i check this video but the same error 
Avatar
Discard
Best Answer

Hello,

Please check the video related to API

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

Thanks.

Avatar
Discard
Related Posts Replies Views Activity
4
May 24
10070
1
Apr 24
1562
0
Nov 23
525
1
Sep 23
564
2
Aug 23
2421