Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
24053 Vizualizări
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",

Imagine profil
Abandonează
Autor Cel mai bun răspuns

Thanks

@Manish Kumar Bohra  but i use odoo 13 i check this video but the same error 
Imagine profil
Abandonează
Cel mai bun răspuns

Hello,

Please check the video related to API

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

Thanks.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
4
mai 24
12606
1
apr. 24
3244
0
nov. 23
1986
1
sept. 23
2076
2
aug. 23
4464