I wrote this inside my module controller
from odoo import http
from odoo.http import request
class Mylib(http.Controller):
@http.route('/mylib/project', auth='public',method=['POST'], csrf=False)
def fun_post(self):
vals = {'name': 'The secret', 'author': 'shakesphere', 'year': 1661,
'book_copy': 12}
return request.env['books.model'].create(vals)
after running this there is no record added, that may be the problem with the URL. I don't know how to put this route...I checked via postman then I got this error,
" The requested URL was not found on the server. If you entered the
URL manually please check your spelling and try again"