WebMocks for Delphi

What is WebMocks?

WebMocks is an open-source HTTP request mocking library for Delphi, inspired by libraries like Ruby's WebMock. It allows you to match HTTP requests and define responses for integration testing your applications without requiring complex configuration or boilerplate code.

Features

  • Flexible HTTP Request Matching
  • Stub HTTP Responses
  • Intercept & Verify Requests
  • Fluent interface for descriptive tests
  • Free & Open Source

Installation

WebMocks can be installed through RAD Studio's GetIt package manager or via GitHub.

git clone https://github.com/appercept/Delphi-WebMocks.git

Usage Example


var
  WebMock: TWebMock;
begin
  WebMock := TWebMock.Create;
  WebMock.StubRequest('GET', '/users/1')
    .ToRespond(
      200,
      '{"id": 1, "name": "John Doe"}',
      'application/json'
    );
end;
      

Get Started

  • Clone the repository or install via GetIt.
  • Include WebMocks in your Delphi project.
  • Start writing reliable and fast HTTP tests.

Detailed instructions and examples are available on GitHub.

Contribute

We welcome contributions! Feel free to submit issues, feature requests, or pull requests on GitHub.

License

WebMocks for Delphi is released under the Apache License (Version 2.0).