3 ms·
Has anyone used a recent Lazarus version to create apps that can connect easily to an HTTP API? Some months ago I had a need to create a "quick and dirty" API
by saganus 8y ago
Has anyone used a recent Lazarus version to create apps that can connect easily to an HTTP API?
Some months ago I had a need to create a "quick and dirty" API utility for internal use and I remembered about Lazarus.
However I couldn't find an HTTP client component that I could use. I just wanted to do the equivalent of a curl GET/POST call.
I'm not sure if maybe I'm not familiar enough with the wiki structure so I missed it, but I remember I searched for about an hour before I gave up.
I'd really like to start using a Delphi-like IDE again as I think it is a very useful and productive tool, especially for ad-hoc stuff.
Any pointers in the right direction would be greatly appreciated!
- DisownedWheat 8y agoI made one that consumed the HN API a little while ago (maybe a year?) using the fphttpclient library bundled with Lazarus. It was pretty simple to use and all the documentation is on the wiki[1]. It is a lot more low level than I am used to personally but it was fun nonetheless. [1]http://wiki.lazarus.freepascal.org/fphttpclient http://wiki.lazarus.freepascal.org/fphttpclient
- saganus 8y agoAh! I do remember I clicked on that briefly but I thought it was too low level like you said, and I thought there would be something else so I kept looking. I guess I was wrong, but it's good to know there is something that works. It also doesn't look that bad anyway, so I might as well give it a try. Thanks!
- zoom6628 8y agoI created a small app to read the Epicor ERP api from freepascal. Fast and simple. Did it as much to refresh my pascal knowledge as to show others that it should not be ignored as a language. As a language is very rich and more cross platform than most others. Lazarus is a cinch to create a GUI that you can then cross compile for other platforms.
- thijsvandien 8y agoIndy is one of the more commonly used networking libraries. It’s open source and in active development (with few breaking changes). Works for Delphi as well as FPC. I’ve had great success with it for FTP, HTTP, POP3, and SMTP.
- saganus 8y agoThanks for the recommendation!
- edwinyzh 8y agoCheck mORMot (https://github.com/synopse/mORMot https://github.com/synopse/mORMot), making http request should be as simple as something like: ` discogsJson := HttpGet('https://api.discogs.com/artists/45/releases?page=1&per_page=100'); https://api.discogs.com/artists/45/releases?page=1&per_page=... ` Here: https://github.com/synopse/mORMot/blob/54dd708d25586008260f2012674361a3a5c6c1e4/SynSelfTests.pas#L7936 https://github.com/synopse/mORMot/blob/54dd708d25586008260f2...