Skip to content

feather-framework/feather-http-urlsession

Repository files navigation

Feather HTTP - URLSession Executor

URLSession-based implementation for the Feather HTTP API package.

Release: 1.0.0-beta.1

Features

  • URLSession transport for the Feather HTTP executor API
  • Designed for modern Swift concurrency
  • Supports absolute URLs, request scheme and authority, or a configured base URL
  • Supports per-request options, including URLSession timeout forwarding
  • Response helpers from Feather HTTP for status, headers, text, JSON, and streaming bodies
  • Unit tests with code coverage support

Requirements

Swift 6.1+ Platforms: Linux, macOS, iOS, tvOS, watchOS, visionOS

  • Swift 6.1+
  • Platforms:
    • Linux
    • macOS 15+
    • iOS 18+
    • tvOS 18+
    • watchOS 11+
    • visionOS 2+

Installation

Use Swift Package Manager; add the dependency to your Package.swift file:

.package(url: "https://github.com/feather-framework/feather-http-urlsession", exact: "1.0.0-beta.1"),

Then add FeatherHTTPURLSession to your target dependencies:

.product(name: "FeatherHTTPURLSession", package: "feather-http-urlsession"),

Usage

DocC API documentation

API documentation is available at the following link.

import FeatherHTTP
import FeatherHTTPURLSession

let executor = URLSessionHTTPExecutor(
    baseURL: URL(string: "https://api.example.com")
)

try await executor.withOperation(
    options: .init(timeout: .seconds(2)),
    request: Request(method: .get, path: "/todos")
) { response in
    let text = try await response.plainTextBody()
    print(text)
}

Warning

This repository is a work in progress, things can break until it reaches v1.0.0.

Executor implementations

The following Swift executor implementations are available:

Development

  • Build: swift build
  • Test:
    • local: make test
    • using Docker: make docker-test
  • Format: make format
  • Check: make check

Contributing

Pull requests are welcome. Please keep changes focused and include tests for new logic.

About

URLSession-based implementation for the Feather HTTP API package.

Resources

License

Stars

Watchers

Forks

Contributors