Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make an HTTPS POST request in Delphi?
    primarykey
    data
    text
    <p>What is the easiest way to do an HTTPS POST request in Delphi? I'm not having problems with making HTTP POST requests, but how can I do it using SSL? I've googled around and haven't found anything that explains this well enough.</p> <p>Here's the code I tried:</p> <pre><code>procedure TForm1.FormCreate(Sender: TObject); var responseXML:TMemoryStream; responseFromServer:string; begin responseXML := TMemoryStream.Create; IdSSLIOHandlerSocketOpenSSL1 := TIdSSLIOHandlerSocketOpenSSL.Create(self); with idSSLIOHandlerSocketOpenSSL1 do begin SSLOptions.Method := sslvSSLv2; SSLOptions.Mode := sslmUnassigned; SSLOptions.VerifyMode := []; SSLOptions.VerifyDepth := 0; host := ''; end; IdHTTP1 := TIdHTTP.Create(Self); with IdHTTP1 do begin IOHandler := IdSSLIOHandlerSocketOpenSSL1; AllowCookies := True; ProxyParams.BasicAuthentication := False; ProxyParams.ProxyPort := 0; Request.ContentLength := -1; Request.ContentRangeEnd := 0; Request.ContentRangeStart := 0; Request.Accept := 'text/html, */*'; Request.BasicAuthentication := False; Request.UserAgent := 'Mozilla/3.0 (compatible; Indy Library)'; HTTPOptions := [hoForceEncodeParams]; end; responsefromserver := IdHTTP1.Post('https://.../','name1=value1&amp;name2=value2&amp;....'); end; </code></pre> <p>When I try to run it I get the following error:</p> <pre><code>Project myProject.exe raised exception class EFOpenError with message 'Cannot open file "C:\...\Projects\Debug\Win32\name1=value1name2=value2 The system cannot find the file specified'. </code></pre> <p>I don't understand that. I sent parameters, though the errors sounds like I would have sent a file.</p> <p>Also I have included libeay32.dll and ssleay32.dll within my myProject.exe folder.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload