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",