@Avra,
If you want quick results then there is a commercial 3rd party lib to consider:
https://forum.lazarus.freepascal.org/index.php/topic,30423.msg193639.html#msg193639
OK, so I am coming from Delphi (FMX no Darwin 32bit compiler). I have purchased the full TMS Cloud Pack which includes the LCL version. I have installed LCL version into Lazarus (As a noob I have other issues that are causing me grief). I can confirm that it does install (there are issues with multiple occurrences of some files) the REST functions are quite simple. If you want to connect to one of the myriad of cloud services they are all built in. I use TMS functions for 'normal' REST calls and I use their functions to decode the JSON returns.
Having said that TMS have done no development on the LCL package since 2015. I queried this and was told as far as they were concerned nothing has change, meh. They did say they were looking at an update, they always say that. I suspect the multiple occurrences of files when I also install SYNACODE is because TMS haven't looked at this package for 3-4 years.
Further, I am using (from Delphi/Win) these components in a DLL and trying to convert to a DYLIB (Lazarus) on Darwin. I have some issues and when i asked TMS they pretty much ignored me. Well TBF they did get back, their response: we have not tested our components in a DLL, we defiantly have not tested our components in a DYLIB. We do not intend to test in a DLL or DYLIB, that would be too much work and there has been no calls for such (there has been - me). So I have the package installed, I haven't got to the point where I'm using it yet, to many other things are breaking/not working, but I suspect much of that is my lack of competence.
Anyway, you get the source with the purchase, and for the most part I have been able to code my way around. The Do.Connect function did not work in XE7 in a DLL so I had to craft a forms based app that talked to the DLL by named pipes to pass the authentication credentials (no help from TMS, we don't do DLLs). It worked again in XE10.2.3 Tokyo.
So bottom line, yes available through TMS. Depending on what you do support is OK or non-existent. LCL packages are OLD.
You can download a trial of the LCL Package/components and see what they do, but if you want functions for generic REST related tasks, you probably need the source. You can also download the user manual from their site, but I'd suggest it's somewhat sparse. It will give you an idea of how to use it (for the named cloud services). FWIW, here's a sample of some (DELPHI) code to do a Dropbox search for a file (and you can just amend the parameters for a non-Dropbox request for example, it would probably be the same or similar in FPC/Lazarus):
URL := DROPBOX_BASE_URL + '/files/search';
AddHeader(headers, 'Authorization', 'Bearer ' + AccessToken);
AddHeader(headers, 'Content-Type', 'application/json');
postdata := '{'
+ '"path": "' + filePath + '",'
+ '"query": "' + fIleName + '",'
+ '"mode": "filename"'
+ '}';
tJSONReturn := '';
ReturnCode := TMSDropbox.HTTPSPost(TMSDropbox.ExtractServer(URL), TMSDropbox.RemoveServer(URL), headers, postdata, response);
if ReturnCode <> 200 then
begin
Of course YMMV.
Kevin