First steps with REST and JSON
First steps with REST and JSON
This is my first try to do something with REST and JSON. The server side is provided by the Delphi Dabbler SWAG archive the client is written with Delphi 10.1 Berlin.
http://blog.dummzeuch.de/2016/09/25/first-steps-rest-json/
This is my first try to do something with REST and JSON. The server side is provided by the Delphi Dabbler SWAG archive the client is written with Delphi 10.1 Berlin.
http://blog.dummzeuch.de/2016/09/25/first-steps-rest-json/
You can try json2delphiClass tool to create strongly types classes for the response and load them from json string. The same applies for the request. It's handy :)
ReplyDeletecould you plz in your blog elaborate on the initialization specifically
ReplyDeletewhy const
WM_Init = 4711;
?
shlomo abuisak google 4711 echt kölnisch Wasser ;-)
ReplyDeleteI use this post message trick to start something after the initialization of a form has finished.
/sub
ReplyDeleteThomas Mueller lol for 4711 ;-)
ReplyDelete/sub
ReplyDeleteInteresting example to see some of the flexibility that the JSON classes offer. However, TRESTClient wraps the concept that is "REST" really well and you should give it a second try. Especially the TDataset mapping is VERY flexible. I might simply blog an extract from my Pexels component that uses it... might get you started with the components. I haven't looked into asynchronous requests yet, which is also something that the EMBT REST lib offers.
ReplyDeleteHolger Flick I just could not make sense of the online help of TRESTClient. Maybe I'll get back to it next time I run across a server supporting REST with some content that interests me. Maybe there is another snippets server somewhere?
ReplyDeletePetar Georgiev I'll have a look.
ReplyDeleteThomas Mueller Documentation is pretty slim with regard to those new technologies. If you can wait a couple of days, you will be able to use my blog post. However, it helps to read into the basic concepts of REST first, i.e. such things as the terminology and basic principles it follows. The EMBT components are really perfect in that regard (e.g. how the components are structured, how the properties are named and how flexible the parameters are).
ReplyDeleteIn case you are interested: https://flixengineering.com/5-minute-snack-retrieve-data-from-a-restful-api-and-import-into-a-dataset-using-the-rest-library
ReplyDeleteflixengineering.com - 5 Minute Snack: Retrieve data from a RESTful API and import into a dataset using the REST library