Anyone execute with success POST via API, using Delphi?

Hi,

I try to integrate a legacy ERP, made with Delphi… but, when I try to make the json post, I got these error:

11:22:07 web.1                | 2016-01-06 11:22:07,694 Request Error
11:22:07 web.1                |  site: webconflex.local
11:22:07 web.1                |  form: {}
11:22:07 web.1                |
11:22:07 web.1                | Traceback (innermost last):
11:22:07 web.1                |   File "/Users/fellipeh/Developer/frappe/apps/frappe/frappe/app.py", line 72, in application
11:22:07 web.1                |     response = frappe.api.handle()
11:22:07 web.1                |   File "/Users/fellipeh/Developer/frappe/apps/frappe/frappe/api.py", line 116, in handle
11:22:07 web.1                |     data = json.loads(frappe.local.form_dict.data)
11:22:07 web.1                |   File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 339, in loads
11:22:07 web.1                |     return _default_decoder.decode(s)
11:22:07 web.1                |   File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 364, in decode
11:22:07 web.1                |     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
11:22:07 web.1                |  TypeError: expected string or buffer
11:22:07 web.1                |

In all DocTypes, the default (like ToDo) and mine…

When I try to use frappeclient [1] works fine… but in Delphi or other software, like Postman, doesn’t work…

I think, I’m doing something wrong when I pass the json data…

Any Idea?

[1]frappe-client/frappeclient at master · frappe/frappe-client · GitHub

I found a solution.

I need to pass data, as Parameter…

on Delphi use this:

RestRequest.AddParameter('data', JSON);

Do not use RestRequest.Params!!!

Cheers!