Server

2.0.0

Asynchronous Swift dynamically configurable network layer.
bteapot/Server

What's New

Swift Concurrency version.

2023-05-29T13:00:04Z

Swift concurrency.

Server

Asynchronous Swift dynamically configurable network layer.

Overview

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:

Server.back
    .request(
        type: .post,
        path: "/ping"
    )
    .start()

Or as complex as:

let userCard =
    try await Server.back
        .request(
            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)
        )

ReactiveSwift version

ReactiveSwift-flavored Server package is archived in the reactiveswift branch and can be referenced by version tags 1.0.x.

Documentation

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

Documentation is also available online.

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon Mar 11 2024 05:30:04 GMT-0900 (Hawaii-Aleutian Daylight Time)