"Error reading Data from Socket" if FPHttpClient response exceeds certain size lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- lazquest · 2020-07-21 15:58 I use the following script to request data from an API. This works fine, but only if the response does not exceed a certain size (~200 lines), otherwise I get an "Error reading Data from Socket" exception back. Anybody got an idea? UPDATE: I tried Indy's idhttp, it works fine here. So it is not because of an API error, the server or something else.  Code: [Select]url := APIUrl+'/positions';  //HTTPS-URL   GetJson := TJSONObject.Create;   With TFPHttpClient.Create(Nil) do   try     AddHeader('Content-Type', 'application/json; charset=UTF-8');     AddHeader('Accept', 'application/json; charset=UTF-8');     AddHeader('VERSION', '2');     AddHeader('X-API-KEY', APIKey);     AddHeader('X-SECURITY-TOKEN',token);     AddHeader('CST', cst);     RequestBody := TStringStream.Create(GetJson.AsJSON);     responseData := Get(url);   finally    Free;   end;   memo1.lines.text:=responseData;