I'm using the Synapse Library and today i want to know how i can send strings via post request to a webserver which uses ssl.
Here is my existing code:
procedure TForm1.syn;
var
Position: Integer;
URL, Params: string;
Response: TMemoryStream;
SynHttp: THTTPSend;
Socket: TTCPBlockSocket;
begin
Response := TMemoryStream.Create;
Socket := TTCPBlockSocket.Create;
SynHttp := THTTPSend.Create;
URL := 'https://gitlab.com';
try
Position := Pos('https', URL);
if Position <> 0 then begin //
SynHttp.Sock.CreateWithSSL(TSSLOpenSSL);
SynHttp.Sock.SSLDoConnect;
// Here i wanna do a Postrequest to the ssl webserver
end
else
// Here i wanna do a Postrequest to the non-ssl webserver
finally
Socket.Free;
Response.Free;
SynHttp.Free;
end;
end;
I wanna connect to a ssl webserver and if i connected successfully i want to perform a POST to the webserver.