17-06-2020, Saat: 14:47
Konuyu hortlatmak gibi olacak ama aynı sıkıntıyı bende yaşadım. Şöyle bir hata alıyordum. Unicode character exists in the target multi-byte code page
Çözüm olarak aşağıdaki kodlara ve commentlere dikkat ederseniz çözümü orada anlattım.
Çözüm olarak aşağıdaki kodlara ve commentlere dikkat ederseniz çözümü orada anlattım.
//---------------------------------------------------- //Rest Server Kodları WebModuleAction kısmı Handled := False; if Validates then begin //buraya dikkat edin özellikle contenttype vermedim. Özeelikle Comment yapıldı. // Response.ContentType := 'application/json'; Response.StatusCode := 200; JSON := TJSONObjectWriter.Create; try qry.SQL.Text := 'SELECT * FROM bla_bla'; ... if qry.RecordCount > 0 then begin ... Response.Content := JSON.JSON.ToString; end else Response.Content := ''; finally ... Handled := True; end; end; //---------------------------------------------------- //---------------------------------------------------- //Client Kodları RestCli.ResetToDefaults; RestCli.BaseURL := getServerName; //http://192.168.20.42:8089 RestCli.Accept := 'application/json, text/plain; q=0.9, text/html;q=0.8,'; RestCli.AcceptCharset := 'utf-8, *;q=0.8'; RestReq.ResetToDefaults; RestReq.Accept := 'application/json, text/plain; q=0.9, text/html;q=0.8,'; RestReq.AcceptCharset := 'utf-8, *;q=0.8'; //client ve request için yukarıdaki şekilde tanımla yapıyorsunuz. Multibyte part data RestRes.ResetToDefaults; //burada da Response için herhangi bir content type veya encoding vermedim. RestReq.Resource := 'monitor'; RestReq.Method := TRESTRequestMethod.rmGET; //----------------------------------------------------
PostgreSQL - Linux - Delphi, Poliüretan

