The Daraja Framework unit tests (DUnit/FPCUnit based) are now moreĀ self-documenting. A new HTTPTestCase test base class provides methods CheckGETResponseEquals, CheckPOSTResponseEquals, CheckGETResponseContains, CheckGETResponse404, and others, which allow to write more concise unit test methods. The changes are available in the master branch, a snapshot is available for download here. Example #1: TestNoMatchingContextReturns404 This test creates a … Continue reading Daraja Framework unit test enhancements
Daraja Framework 1.0 released
Daraja Framework is a new free open source library for Object Pascal (Free Pascal 2.6.4, Free Pascal 3.0, Delphi 2009+) available on GitHub. It is based on the stand-alone HTTP server in Internet Direct (Indy) and the successor to the Habari Web Components library by Habarisoft. With the Daraja Framework, writing well organized stand alone … Continue reading Daraja Framework 1.0 released
Indy 10.6 HTTPS POST example with JSON body
The Indy (Internet Direct) TIdHTTP now creates a default SSLIOHandler when requesting an HTTPS url. This makes TIdHTTP a little easier to use "out of the box". (blog article). The code below sends a hard-coded JSON object as POST body to a secure url. Note: if you need to customize the SSLVersions used, or specify … Continue reading Indy 10.6 HTTPS POST example with JSON body
Indy HTTP server: multipart/form-data file upload example
The Internet Direct (Indy) 10 HTTP server class TIdHTTPServer does support HTTP file upload with multipart/form-data encoding. The solution below is based on code in the Indy and Delphi newsgroups. Please note that a patch in the Indy library is required, as shown on Stackoverflow in Indy MIME decoding of Multipart/Form-Data Requests returns trailing CR/LF. … Continue reading Indy HTTP server: multipart/form-data file upload example
Send secure SMTP email from Delphi applications
Introduction Sending email from Windows, Android and iOS Delphi applications over public SMTP servers requires an encrypted connection. Internet Direct (Indy) configuration for SSL/TLS connections is shown in this example source code. Disclaimer This code is mostly based on code posted in the Embarcadero forum and here. Example usage [sourcecode language="Delphi"] procedure TFormMailDemo.ButtonSendClick(Sender: TObject); var … Continue reading Send secure SMTP email from Delphi applications
Indy 10 TIdTCPServer: Server-side message push example
Get the source code on Github This example uses a Delphi 2009 VCL application with a main form, which contains only one visual component, a TMemo named "MemoLog". Client and server are both started in the FormCreate event. [sourcecode language="Delphi"] procedure TServerPushExampleForm.FormCreate(Sender: TObject); begin ExampleServer := TMyPushServer.Create; ExampleServer.DefaultPort := 8088; ExampleServer.Active := True; ExampleClient := … Continue reading Indy 10 TIdTCPServer: Server-side message push example
Habari Client Libraries for Delphi and Free Pascal – new releases
4. December 2013 - New versions of all Habari message broker client libraries are available. The new release of Habari Client libraries is mainly a maintenance release. The new library versions are: Habari Client for ActiveMQ 3.6 (tested with ActiveMQ version 5.9.0) Habari Client for Apollo 1.6 (tested with Apollo version 1.6) Habari Client for … Continue reading Habari Client Libraries for Delphi and Free Pascal – new releases
Habari Client Libraries for Delphi and Free Pascal – new releases
New versions of all Habari message broker client libraries is available. The new release of Habari Client libraries introduces new features, including improved Free Pascal support: New: Remote Procedure Call (RPC) demo program New: Heart-beating tests using built-in STOMP server New: Connection parameter "subscribe.receipt" to request and verify broker confirmations for subscriptions New: Connection pool … Continue reading Habari Client Libraries for Delphi and Free Pascal – new releases
The easy way to update Internet Direct (Indy)
Updating Internet Direct (Indy) 10 component packages in the Delphi IDE to a newer version is quite time-consuming. Doing backups, searching and removing old source and binary files, changing IDE paths - all these steps cause developers to think twice before trying a new release of the Indy library. Quick switching between versions - to … Continue reading The easy way to update Internet Direct (Indy)