Delphi Internet Development with Synapse


Along with Indy and ICS, Synapse, is one of the most use open-source set of Internet components. It supports HTTP, SMTP, ICMP, etc. Support is available through the Synapse mailing list (archives), and a wiki. Unlike most Internet libraries out there, Synapse works synchronously, making development easier.


  1. Downlooad and unzip the latest source code into the directory of your choice, eg. C:\SYNAPSE
  2. Open the Delphi IDE, click on Tools > Env't Options > Library, and add C:\SYNAPSE\LIB to the Library Path
  3. Create a new project, and add the ad hoc Synapse unit to the Uses clause, eg. Uses httpsend,synacode;

Getting a web page

Here's how to connect to a web server and sending formatted data with a GET call:

  sl : TStringList;
  i : Integer;
  data : String;
  //Must encode input to take care of non-authorized characters
  data := 'name=' + ParamStr(1);
  data := data + '&' + 'number=' + ParamStr(2);
  data := data + '&' + 'date=' + ParamStr(3);
  data := data + '&' + 'time=' + ParamStr(4);
  data := EncodeURL(data);
  sl := TStringList.Create;
  with THTTPSend.Create do
    if HttpGetText('http://localhost/put.php?' + data,sl) then
      for i := 0 to sl.Count-1 do
      WriteLn('Cannot get');