network application migration Delphi -> Lazarus lazarus / 21-General ---------------------------------------------------------------------- sunjob · 2022-04-20 18:21 good afternoon/night! trying to move the app to Lazarus Code: [Select]Delphi (unknown version) Lazarus - 2.0.12/2.2.0 fpc - according to versions Lazarus Indy-10.6.2.0 the application is intended for testing "network technologies" (sending / receiving) application conversion failed: menu/Tools/Delpi Conversion manually created a project, added components to the form, transferred the code 1-part/server is running (listens on port, accepts requests, outputs to TMemo) 2-part/client component THTTPClient, tried to replace with "similar", got an exception Code: [Select]THTTPClient --> FPHTTPClient / use fphttpclient IdHTTP       / Indy-10.6.2.0 Network Technologies - I understand very poorly, this is not "My- Theme", I'm trying to figure it out Thank YOU Code: [Select]mClientLog            : TMemo; procedure TForm1.btnGetClick(Sender: TObject); var   SS: TStringStream;   HttpClient: THTTPClient; begin   SS := TStringStream.Create('', TEncoding.UTF8);   try     HttpClient := THTTPClient.Create();     try       HttpClient.Get(teURL.Text, SS);       mClientLog.Lines.Add(SS.DataString);     finally       HttpClient.Free;     end;   finally     SS.Free;   end; end; function TForm1.PostRequest(const AURL: String; ASource: TStrings): TStream; var   SS: TStringStream;   HttpClient: THTTPClient; begin   Result := TStringStream.Create('', TEncoding.UTF8);   try     HttpClient := THTTPClient.Create();     try       HttpClient.Post(AURL, ASource, Result);     finally       HttpClient.Free;     end;   except     Result.Free;     raise;   end; end; ////////////////////////////////////////////////////////////////////// ////////// // // tried to replace with TFPHTTPClient - throws an exception // -> exception - Invalid Protocol: "" // ////////////////////////////////////////////////////////////////////// ////////// function TForm1.PostRequest(const AURL: String; ASource: TStrings): TStream; var   SS: TStringStream;   HttpClient: TFPHTTPClient; // begin Result := TStringStream.Create('', TEncoding.UTF8);   try     HttpClient := TFPHTTPClient.Create(nil);     try       HttpClient.Post(AURL, ASource); // -> exception - Invalid Protocol: ""     finally       HttpClient.Free;     end;   except     Result.Free;     raise;   end; end; ---------------------------------------------------------------------- bobby100 · 2022-04-20 18:41 It looks like the full address is expected, including http:// or https:// at the beginning of the URL.