TWetGMaps - call a HTTP/HTTPS get virtual function |
Post Reply ![]() |
Author | |
Schwenk Peter ![]() New Member ![]() Joined: 13 May 2015 Posts: 12 |
![]() ![]() ![]() ![]() Posted: 09 Jun 2015 at 11:25pm |
Having the TWebGMaps and TWebGMapsGeocoding virtual function for making the HTTP/HTTPS API calls would be nice to have. Obviously not everyone may want to use Indy for HTTP but for those of us who do, this would be nice for the reasons noted in the following example comments...
{code} function TTheAPIComponent.HttpsGet(Url: string): string; override; var IdHttp: TIdHTTP; IdHandler: TIdSSLIOHandlerSocketOpenSSL; begin Result := ''; IdHTTP := TIdHTTP.Create(nil); IdHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); try IdHandler.SSLOptions.RootCertFile := ''; IdHandler.SSLOptions.KeyFile := ''; IdHandler.SSLOptions.CertFile := ''; IdHandler.SSLOptions.Method := sslvSSLv23; IdHandler.SSLOptions.VerifyMode := []; IdHandler.SSLOptions.VerifyDepth := 0; IdHttp.IOHandler := IdHandler; IdHttp.HandleRedirects := True; { allow use of HTTPS for using API key on URL } if UseHTTPS then Url := ReWriteURLForHTTPS(Url); { allow passing API key on URL for Google counters to work } if Trim(APIKey) <> '' then Url := AppendAPIKeyToURL(Url) { allow use for Google Maps for Work Client ID & Signature } else if Trim(ClientID) <> '' then Url := AppendClientIDToURL(Url); { allow for local logging of API calls in application } if Assigned(FOnHttpsGet) then FOnHttpsGet(Url); Result := IdHttp.Get(Url); finally FreeAndNil(IdHandler); FreeAndNil(IdHttp); end; end; {code} |
|
![]() |
|
Bruno Fierens ![]() TMS Support ![]() Joined: 11 May 2010 Posts: 8398 |
![]() ![]() ![]() ![]() |
Thanks. We'll consider this for a future update.
|
|
![]() |
|
Schwenk Peter ![]() New Member ![]() Joined: 13 May 2015 Posts: 12 |
![]() ![]() ![]() ![]() |
Thanks!
|
|
![]() |
Post Reply ![]() |
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |