Skip to Content
Menu
This question has been flagged

I am using xmlrpc, I need to reset the user password from mobile app but I faced the error below:

Function declared as capable of handling request of type 'json' but called with a request of type 'http'

 

Avatar
Discard
Best Answer

The error message "Function declared as capable of handling request of type 'json' but called with a request of type 'http'" is related to the way the function is being called and the type of request it is expecting.

When you use the xmlrpc library in Odoo, you are able to call the server's methods using the JSON-RPC protocol, which is a lightweight remote procedure call (RPC) protocol encoded in JSON. However, the error message suggests that the function you are trying to call is expecting a request of type 'json' while you are calling it with a request of type 'http'.

One possible solution to this issue is to make sure that you are using the correct protocol when calling the function. For example, if the function is expecting a JSON-RPC request, you should use the jsonrpc library to call the function, instead of using xmlrpc. Also, you can check the documentation of the function you are trying to call, and make sure that the request type is supported.

Another solution is to check the route of the function and make sure that the route accepts 'http' request, and if not, you can add the route to accept 'http' requests.

It is also recommended to check the version of the Odoo, as some versions of Odoo have different ways of handling the requests.

If none of the above solutions work, you can check the server logs for error messages that might indicate the problem

Avatar
Discard
Related Posts Replies Views Activity
1
Jul 24
1986
1
Dec 22
1382
1
Jun 22
2448
3
Jan 23
4812
1
Mar 22
3574