I need to create a method with a route like this:
@http.route('/web/test/mytest', type='json', auth="none")
def my_test(self, fields):
do something...return True
How can I create another method in Odoo to be able to call it, from different odoo server, and pass some params.
Example from a server1.mydomain.com:8072 just make a json call (passing some params) to server2.mydomain:8072/web/test/mytest.
I've tried something like this, with no success:
params = {'param1': 'a', 'param2': 'b}
url = '{scheme}://{server}:{port}{path}?{params}'.format(scheme='http',
server='localhost', port='8072', path='/web/test/mytest', params=werkzeug.url_encode(params))
headers = {'content-type': 'application/json'}
result = requests.get(url, headers=headers).json()
I got this error:
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Or you think I should use http (one of the parameter could be a big file)?