TMS Sparkle Native API HTTP Client Server For Delphi XE5 Firemonkey On Android And IOS
Admin
TMS Software has released a new cross platform HTTP Client and Server library for Delphi XE5 Firemonkey. The server is for Windows using the http.sys stack and runs on Windows Vista or Windows 2008 Server and higher. The client runs on Android, IOS, Windows, and OSX. SSL and HTTPS are supported across all of the platforms. TMS Sparkle says that it is a thin abstraction layer over the existing native APIs for each platform so that your app will benefit from new upgrades to each platform without having to update your own app. They plan to use this new HTTP client and Server with some upcoming components they have brewing called TMS RemoteDB and TMS XData. The HTTP server side of it looks pretty powerful and appears to support virtual hosting (multiple applications at different addresses on the same port). It is a commercial component library but it does not currently appear to have a free trial. Here is some sample source code from the library for making an HTTP client request: uses {...}, Sparkle.Http.Client;
var
Client: THttpClient;
Request: THttpRequest;
Response: THttpResponse;
ResponseBody: string;
begin
Request := nil;
Response := nil;
Client := THttpClient.Create;
try
Request := Client.CreateRequest;
Request.Uri := 'http://myserver/customers';
Request.Method := 'POST';
Request.SetContent(TEncoding.UTF8.GetBytes('Request content'));
Response := Client.Send(Request);
if Response.StatusCode = 200 then
ResponseBody := TEncoding.UTF8.GetString(Response.ContentAsBytes);
finally
Request.Free;
Response.Free;
Client.Free;
end; Head over and check out the new TMS Sparkle HTTP Client Server library.