Swiftpack.co - bteapot/Server as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by bteapot.
bteapot/Server 1.0.8
Lightweight ReactiveSwift dynamically configurable network layer.
⭐️ 4
🕓 32 weeks ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/bteapot/Server.git", from: "1.0.8")


Lightweight ReactiveSwift dynamically configurable network layer.


This small library provides solution for most modern Swift application's networking needs. It designed to be dependable on application user's state, dynamically changing it's configuration and request parameters on user authorization or other environment changes. Information exchange – encoding of outgoing data, setting of corresponding request headers, checking response code, decoding received data – is done through single method.

Making a request would be as simple as:

        type: .post,
        path: "/ping"

Or as complex as:

        type: .post,
        path: "/userinfo",
        query: [
            "id": userID,
        send: .multipart([
            .png(avatarImage, name: "avatar", filename: "avatar.png"),
            .text(firstName, name: "first_name"),
            .text(lastName, name: "last_name"),
        take: .json(UserCard.self)
    .reportError(title: "Can't update user card")
    .observe(on: QueueScheduler.main)
    .startWithValues { userCard in
        // process updated user card


Complete Xcode documentation is included with code and its archived version attached to GitHub release page.

Documentation is also available online.


Stars: 4
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

General configuration simplification
32 weeks ago

URLSession moved into Config structure. – Server.assets replaced by Server.config. – SessionConfiguration replaced with direct use of URLSessionConfiguration. – Session configuration and authentication challenge handler are no longer stored in Config.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics