Recent

Author Topic: synapse getmethod to https?!  (Read 2926 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2261
    • Lazarus and Free Pascal italian community
synapse getmethod to https?!
« on: January 05, 2014, 02:22:43 pm »
Hello guys, I need to query Google automatically from my application, only that I find it difficult to retrieve the result when it comes (like google) to https and not http. I use synapse with HttpMethod but it does not work, who can tell me why?!

The following is my code

Code: [Select]
uses
       ssl_openssl,ssl_openssl_lib


var http : THTTPSend;
begin

      http:=THTTPSend.Create;
      Http.Sock.CreateWithSSL(TSSLOpenSSL);
      http.Sock.SSLDoConnect;
      if not http.HTTPMethod('GET',Url) then
        begin
             RecuperaSSLHtml:='';
             exit;
        end
      else
        begin
          page.LoadFromStream(http.Document);
          for i:=0 to page.Count-1 do
              risultato:=risultato + UpCase(page[i]);
        end;
        http.Clear;
        page.Clear;
end;
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

 

TinyPortal © 2005-2018