I need to create custom rest APIs in new .py file . It used to work fine is version 7.
But when same used in Latest production VM. It’s giving below error.
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 59, in application
init_request(request)
File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 119, in init_request
make_form_dict(request)
File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 127, in make_form_dict
args = json.loads(request.data)
File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
imgonline-com-ua-twotoone-8RW2YIajPl3sQebQ6731×482 265 KB
Please check the screenshots(merged)
Just tested with a simple GET function
Input should be in json format,
I think you need to select json input in Postman (Body->raw->json (from dropdown))
{"a":"Test"}
Thanks, But getting same issue if the function is without parameters.
Is there any issue with app.py of this VM?
Because the older version worked fine with all scenarios.