Synapse Delphi HTTPS SSL GET Request

后端 未结 2 1195
灰色年华
灰色年华 2021-02-06 15:44

Only a GET request to a HTTP url works. If i try to request a HTTPS url then it doesn\'t return anything. I pretty much tried everything. Appreciate any help.

Here\'s my

相关标签:
2条回答
  • 2021-02-06 15:45

    Make sure:

    1. your exe application can access ssleay32.dll and libeay32.dll - the easiest way is to copy them into the directory of your exe.
    2. you added ssl_openssl.pas and ssl_openssl_lib.pas to your project.

    Then it should work instantly.

    0 讨论(0)
  • 2021-02-06 16:04

    Use HTTPSend and headers, works with SSL in HTTPMethod. If you use in URL 'https:' instead only 'http:', then your request is made by SSL/TLS connection:

    aURL:='https://api.metadefender.com/v4/file/bzIwMDYxNi1TSW42NDBPVlprTWw3YjRBMQ';
    
    with THTTPSend.create() do begin
      Headers.Add('apikey: 6b337c92c792174a54acd715ab1aae64');
      writeln(botostr(HTTPMethod('GET',aURl)));
      writeln('synapse get: '+StreamtoString3(document)) 
      writeln(itoa(ResultCode)+' '+ResultString);
      Clear;
      Free;
    end;  
    
    0 讨论(0)
提交回复
热议问题