A basic HTTP abstraction for Swift, providing a shared API surface for HTTP executors.
- Basic request representation API surface
- Designed for modern Swift concurrency
- Extensible executor protocol with per-request options
- Response helpers for status, headers, text, JSON, and streaming bodies
- Unit tests with code coverage support
- Swift 6.1+
- Platforms:
- Linux
- macOS 15+
- iOS 18+
- tvOS 18+
- watchOS 11+
- visionOS 2+
Use Swift Package Manager; add the dependency to your Package.swift file:
.package(url: "https://github.com/feather-framework/feather-http", from: "1.0.0-beta.1"),Then add FeatherHTTP to your target dependencies:
.product(name: "FeatherHTTP", package: "feather-http"),API documentation is available at the following link. Refer to the mock objects in the Tests directory if you want to build a custom executor implementation.
Requests are executed through RequestRepresentable values. Use Request for already-built HTTPRequest and HTTPBody pairs, or use JSONRequest, BinaryRequest, and MultipartRequest when the request type should set up the matching Content-Type header and body payload. Responses are handled through ResponseContext, which exposes status, header, plain-text, JSON, data, and streaming-body helpers. Per-request configuration, including response body limits and timeouts, is passed with RequestOptions.
Warning
This repository is a work in progress, things can break until it reaches v1.0.0.
The following Swift executor implementations are available:
- Build:
swift build - Test:
- local:
make test - using Docker:
make docker-test
- local:
- Format:
make format - Check:
make check
Pull requests are welcome. Please keep changes focused and include tests for new logic.