eSeGeCe — Enterprise Communication Components for Delphi & .NET
FEATURED · sgcREST

REST APIs from an OpenAPI contract, native in Delphi

Three components cover two jobs. TsgcHTTPRESTServer is a REST server with CORS, opt-in /metrics and /health endpoints and multi-tenant request resolution built in. TsgcWSAPIServer_OpenAPI loads an OpenAPI 3.x contract with LoadFromFile and dispatches, validates and authenticates every request against it. TsgcOpenAPI_Client is the base class behind typed clients for any OpenAPI-described API. Standalone, the sgcWebSockets Core runtime is included.

  • 3 component classes
  • REST Server · OpenAPI Server · OpenAPI Client
  • CORS, /metrics, /health, multi-tenancy
  • Delphi 7 to 13 · C++ Builder

Two Palette Components, One Client Base Class

sgcREST is a standalone package. It bundles the sgcWebSockets Core runtime it is built on, and every license ships with full source code, so the REST dispatch and OpenAPI validation step through in your own debugger.

2 Palette components TsgcHTTPRESTServer on the SGC REST page, TsgcWSAPIServer_OpenAPI on the SGC OpenAPI page.
3 Component classes total REST server, OpenAPI server and the OpenAPI client base class.
2 Built-in endpoints /metrics and /health, opt-in and served behind whatever Authentication the server already enforces.
1 Standalone installer The sgcWebSockets Core runtime and the HTTP/TLS layer both ship inside the package.
100% Source code included Every license carries the full source of all three components and the bundled runtime.
sgcREST

REST server and OpenAPI server/client components for Delphi and C++ Builder. A standalone package with the sgcWebSockets Core runtime bundled in, full source code, and royalty-free deployment.

Publish an API, or Consume One

The three classes split cleanly by direction. The REST server and the OpenAPI server publish endpoints your callers reach. The OpenAPI client base class is what generated SDKs use to call someone else's endpoints.

REST Server

CORS, Metrics, Health and Tenancy, Built In

TsgcHTTPRESTServer extends the sgcWebSockets HTTP server with the everyday plumbing a REST API needs: CORSOptions for cross-origin requests, opt-in /metrics and /health endpoints through ServerStats, and multi-tenant request resolution through Tenancy, by host, path, header or JWT claim. Tenant exposes the resolved value to your own request handlers.

View the REST server →
OpenAPI Server

Load a Contract, Dispatch and Validate Every Request

TsgcWSAPIServer_OpenAPI reads an OpenAPI 3.x document with LoadFromFile or LoadFromString and turns it into a live dispatcher: every incoming request is matched against the contract and routed to your OnRequest handler by operation id. OnValidationError, OnAuthenticate, OnValidateAPIKey, OnValidateBasic and OnValidateBearer cover the security schemes the spec declares, and OnBeforeRequest/OnAfterRequest bracket the call.

View the OpenAPI server →
OpenAPI Client

One Base Class Behind Every Generated SDK

TsgcOpenAPI_Client is the generic runtime client for any OpenAPI-described API: Authentication covers Basic auth, bearer token, generic OAuth2 and JWT, and HTTP_REQUEST and HTTP_REQUEST_Async execute the call. Point SetBaseURL at a contract you loaded or generated yourself and it is ready to call.

See what it can do →
Escape hatch

Every Callback the Spec Needs

OnException catches handler errors before they reach the wire, and the validation and authentication events all receive the parsed TsgcOpenAPIServerContext, with PathParams, QueryParams and RespondJSON, so nothing about why a call was accepted or rejected is hidden from you.

The validation surface →
Cross-platform

Five Platforms, One Runtime

The REST server and the OpenAPI server are TsgcHTTPServer descendants, and the OpenAPI client runs on the same HTTPS stack as the rest of the Core runtime. From Delphi 7 through RAD Studio 13 and on C++ Builder.

The feature matrix →

Reference pages for each component:

Publish an Endpoint, or Publish a Contract

The REST server hands you the request directly. The OpenAPI server hands you a validated, already-matched operation. Both compile the same in Delphi 7 to 13 and C++ Builder.

uses
  sgcHTTP_REST_Server, sgcHTTP_REST_Server_Stats;
var
  RESTServer: TsgcHTTPRESTServer;
  Stats: TsgcHTTPServerStats;
begin
  // REST server: CORS, health/metrics and tenancy in one component
  RESTServer := TsgcHTTPRESTServer.Create(nil);
  Stats := TsgcHTTPServerStats.Create(nil);
  Stats.Endpoints.Health.Enabled := True;

  RESTServer.Port := 8080;
  RESTServer.CORSOptions.Enabled := True;
  RESTServer.CORSOptions.AllowOrigins := 'https://app.example.com';
  RESTServer.ServerStats := Stats;
  RESTServer.OnCommandGet := RESTServerCommandGet;
  RESTServer.Active := True;
end;

procedure TForm1.RESTServerCommandGet(AContext: TIdContext;
  ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
begin
  AResponseInfo.ContentText := '{"status":"ok"}';
end;
uses
  sgcWebSocket_Server_API_OpenAPI, sgcHTTP_Server;
var
  OpenAPIServer: TsgcWSAPIServer_OpenAPI;
begin
  // OpenAPI server: load the contract, dispatch by operation id
  OpenAPIServer := TsgcWSAPIServer_OpenAPI.Create(nil);
  OpenAPIServer.Server := sgcHTTPServer1;
  OpenAPIServer.LoadFromFile('petstore.yaml');
  OpenAPIServer.OnRequest := OpenAPIServerRequest;

  sgcHTTPServer1.Port := 8080;
  sgcHTTPServer1.Active := True;
end;

procedure TForm1.OpenAPIServerRequest(Sender: TObject;
  const aOperationId: string; const aContext: TsgcOpenAPIServerContext;
  var Handled: Boolean);
begin
  if aOperationId = 'getPetById' then
  begin
    aContext.RespondJSON(200,
      '{"id":"' + aContext.PathParamAsString('petId') + '","name":"Rex"}');
    Handled := True;
  end;
end;

The same shape in Object Pascal and in C++ Builder. The full feature matrix →

Two Things Worth Knowing First

What sgcREST needs from you, and what it does not. Both answers are short, and both are on this page rather than in the small print.

Three components, two jobs
component                           role
TsgcHTTPRESTServer                  publish a REST API: CORS,
                                       /metrics, /health, tenancy
TsgcWSAPIServer_OpenAPI             publish a REST API from an
                                       OpenAPI 3.x contract
TsgcOpenAPI_Client                  consume any OpenAPI-described API

Both server components are TsgcHTTPServer
  descendants, so they attach to the same Port,
  TLSOptions and Authentication your other
  sgcWebSockets servers already use.

sgcREST is standalone

Standalone, the sgcWebSockets Core runtime is included: the HTTP/TLS server stack the REST server and the OpenAPI server both run on, and the JSON layer the OpenAPI client decodes responses with. One installer, full source code in the box.

REST server and OpenAPI server share one base

TsgcHTTPRESTServer and the HTTP server a OpenAPI server attaches to are both TsgcHTTPServer descendants, so CORS, TLS, Authentication and the request pipeline behave the same way whichever one is publishing your API.

The OpenAPI client needs only the contract

TsgcOpenAPI_Client resolves paths, headers and authentication straight from the OpenAPI document, over the Core runtime's plain HTTPS stack.

Delphi and C++ Builder

sgcREST targets Delphi 7 through RAD Studio 13 and C++ Builder. The REST server also ships inside sgcWebSockets Professional and higher, and the OpenAPI server and client ship with the existing sgcOpenAPI pack too, so an existing license may already cover you. The free trial installer is the sgcWebSockets All-Access trial, so all three classes can be evaluated today.

OpenAPI 3.x CORS Multi-tenancy /metrics & /health Full source

Every component and property →

sgcREST implements the REST and OpenAPI surfaces your contract describes rather than wrapping a code generator you do not control, so requests, validation and dispatch are all first-class methods and events, and full source code means nothing in between is a black box.

Thirteen Libraries, One Toolbox

sgcREST is one of thirteen eSeGeCe component libraries for Delphi, C++ Builder and .NET. They share conventions, they ship with full source, and they deploy royalty-free.

sgcREST

REST server, OpenAPI server and OpenAPI client components for Delphi and C++ Builder. Standalone, with the sgcWebSockets Core runtime bundled in.

Learn more →

sgcHTTP

HTTP/2 client, gRPC client and Google Cloud Pub/Sub, Calendar and FCM clients for Delphi and C++ Builder. Standalone, with the sgcWebSockets Core runtime bundled in.

Learn more →

sgcAuth

OAuth2 client, JWT client and WebAuthn support for Delphi and C++ Builder. Standalone, with the sgcWebSockets Core runtime bundled in.

Learn more →

sgcWebSockets

WebSocket, HTTP/2, MQTT, AMQP, WebRTC, AI and 30+ API integrations for Delphi, C++ Builder, Lazarus and .NET. Its Enterprise edition includes gRPC too.

Learn more →

sgcMQ

MQTT, AMQP 0.9.1 and 1.0, Apache Kafka and STOMP client components for Delphi and C++ Builder. Standalone, with the sgcWebSockets Core runtime bundled in.

Learn more →

sgcSocial

Telegram and WhatsApp Business client components for Delphi and C++ Builder. Standalone, with the sgcWebSockets Core runtime bundled in.

Learn more →

sgcHTML

Server-side HTML and UI components on Bootstrap 5 and htmx for Delphi, C++ Builder and .NET.

Learn more →

sgcQUIC

Raw QUIC transport and an HTTP/3 client and server, with WebTransport. An add-on to sgcWebSockets Enterprise.

Learn more →

sgcAI

AI, LLM and MCP components for Delphi and C++ Builder. Seven LLM providers behind one component, plus MCP, embeddings and speech. Standalone, with the sgcWebSockets Core runtime bundled in.

Learn more →

sgcOpenAPI

OpenAPI 3.x parser, native Pascal SDK generator, OpenAPI server component, and 1,195+ pre-built cloud SDKs.

Learn more →

sgcSign

XAdES, PAdES, CAdES and ASiC for documents, Authenticode, ClickOnce, NuGet and VSIX for code.

Learn more →

sgcBiometrics

Windows Hello, fingerprint sensors and the Windows Biometric Framework for Delphi and C++ Builder.

Learn more →

sgcIndy

Updated Indy TCP/IP components with modern TLS, IPv6 and HTTP/2 for Delphi 7 through 13.

Learn more →

View pricing and licenses Download the free trial

What Developers Say

Trusted by Delphi, C++ Builder, Lazarus and .NET developers around the world.

Your sgcWebSockets library is very useful and easy to setup. Keep up the good work!

Simone Moretti Delphi Developer

sgcWebSockets is amazing and your support is the best!

Christian Meyer Founder & CTO

Thanks so much for your help and support, I love your components.

Mark Steinfeld CTO

Latest from the blog

View all posts →

You are seeing the REST & OpenAPI view of eSeGeCe.

Show me another angle →
30-Day Money-Back GuaranteeNot satisfied? Request a full refund within 30 days of purchase. See refund policy

REST APIs, OpenAPI Contracts, Native Code

A REST server, an OpenAPI server and an OpenAPI client, with the sgcWebSockets Core runtime bundled in and full source code in the box.