I'm looking for modRest class examples to learn in practice, how to use REST technology in geting data. I need to replace ODBC technology for retrieving data from my Progress Openedge database, with a REST method.
I've created test environment on local computer. I've tested my REST application by calling URLs: "http://localhost:8810/Sports/rest/SportsService/Customer" and with filter "http://localhost:8810/Sports/rest/SportsService/Customer?filter=custnum=1". In both cases I've got correct JSON file, displayed in Chrome.
How can I use ModRest class to obtain the same in Modx ?
I used 'modRest' class with config['baseUrl'] parameter="http://localhost:8810/Sports/rest/SportsService" ;
next called 'get' method with url="Customer?" and GOT ALL "customers" data in json format !
I don't quite understand why have I to use "?" in this case.
I have no idea how to transform "Customer?filter=custnum=1" URl to obtain 1 record.
Could you give me any suggestion ?
Regards
Andrzej