You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case of **success**, a **200** status with the JSON-serialized return value of the called method
78
78
in the body.
79
79
80
-
.. code:: http
81
-
82
-
HTTP/1.1 200 OK
83
-
Content-Type: application/json; charset=utf-8
84
-
85
-
[
86
-
{"id": 25, "name": "Deco Addict"}
87
-
]
88
-
89
-
In case of **error**, a **4xx**/**5xx** status with a JSON-serialized error object in the body.
80
+
.. example::
81
+
.. code:: http
90
82
91
-
.. tabs::
92
-
93
-
.. code-tab:: http
94
-
95
-
HTTP/1.1 401 Unauthorized
83
+
HTTP/1.1 200 OK
96
84
Content-Type: application/json; charset=utf-8
97
85
98
-
{
99
-
"name": "werkzeug.exceptions.Unauthorized",
100
-
"message": "Invalid apikey",
101
-
"arguments": ["Invalid apikey", 401],
102
-
"context": {},
103
-
"debug": "Traceback (most recent call last):\n File \"/opt/Odoo/community/odoo/http.py\", line 2212, in _transactioning\n return service_model.retrying(func, env=self.env)\n File \"/opt/Odoo/community/odoo/service/model.py\", line 176, in retrying\n result = func()\n File \"/opt/Odoo/community/odoo/http.py\", line 2177, in _serve_ir_http\n self.registry['ir.http']._authenticate(rule.endpoint)\n File \"/opt/Odoo/community/odoo/addons/base/models/ir_http.py\", line 274, in _authenticate\n cls._authenticate_explicit(auth)\n File \"/opt/Odoo/community/odoo/addons/base/models/ir_http.py\", line 283, in _authenticate_explicit\n getattr(cls, f'_auth_method_{auth}')()\n File \"/opt/Odoo/community/odoo/addons/base/models/ir_http.py\", line 240, in _auth_method_bearer\n raise werkzeug.exceptions.Unauthorized(\nwerkzeug.exceptions.Unauthorized: 401 Unauthorized: Invalid apikey\n"
104
-
}
86
+
[
87
+
{"id": 25, "name": "Deco Addict"}
88
+
]
105
89
106
-
.. tab:: Debug
107
-
108
-
.. code::
109
-
110
-
Traceback (most recent call last):
111
-
File "/opt/Odoo/community/odoo/http.py", line 2212, in _transactioning
112
-
return service_model.retrying(func, env=self.env)
113
-
File "/opt/Odoo/community/odoo/service/model.py", line 176, in retrying
114
-
result = func()
115
-
File "/opt/Odoo/community/odoo/http.py", line 2177, in _serve_ir_http
In case of **error**, a **4xx**/**5xx** status with a JSON-serialized error object in the body.
124
91
125
92
:name: The fully qualified name of the Python exception that occured.
126
93
:message: The exception message, usually the same as `arguments[0]`.
127
94
:arguments: All the exception arguments.
128
95
:context: The context used by the request.
129
96
:debug: The exception traceback, for debugging purpose.
130
97
98
+
.. example::
99
+
100
+
.. tabs::
101
+
102
+
.. tab:: HTTP
103
+
.. code:: http
104
+
105
+
HTTP/1.1 401 Unauthorized
106
+
Content-Type: application/json; charset=utf-8
107
+
108
+
{
109
+
"name": "werkzeug.exceptions.Unauthorized",
110
+
"message": "Invalid apikey",
111
+
"arguments": ["Invalid apikey", 401],
112
+
"context": {},
113
+
"debug": "Traceback (most recent call last):\n File \"/opt/Odoo/community/odoo/http.py\", line 2212, in _transactioning\n return service_model.retrying(func, env=self.env)\n File \"/opt/Odoo/community/odoo/service/model.py\", line 176, in retrying\n result = func()\n File \"/opt/Odoo/community/odoo/http.py\", line 2177, in _serve_ir_http\n self.registry['ir.http']._authenticate(rule.endpoint)\n File \"/opt/Odoo/community/odoo/addons/base/models/ir_http.py\", line 274, in _authenticate\n cls._authenticate_explicit(auth)\n File \"/opt/Odoo/community/odoo/addons/base/models/ir_http.py\", line 283, in _authenticate_explicit\n getattr(cls, f'_auth_method_{auth}')()\n File \"/opt/Odoo/community/odoo/addons/base/models/ir_http.py\", line 240, in _auth_method_bearer\n raise werkzeug.exceptions.Unauthorized(\nwerkzeug.exceptions.Unauthorized: 401 Unauthorized: Invalid apikey\n"
114
+
}
115
+
116
+
.. tab:: Debug
117
+
.. code::
118
+
119
+
Traceback (most recent call last):
120
+
File "/opt/Odoo/community/odoo/http.py", line 2212, in _transactioning
121
+
return service_model.retrying(func, env=self.env)
122
+
File "/opt/Odoo/community/odoo/service/model.py", line 176, in retrying
123
+
result = func()
124
+
File "/opt/Odoo/community/odoo/http.py", line 2177, in _serve_ir_http
0 commit comments