Swiftpack.co - avreolko/VCHTTPNetworking as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
avreolko/VCHTTPNetworking
Simple and declarative request builder
.package(url: "https://github.com/avreolko/VCHTTPNetworking.git", from: "3.1.0")

Tests

VCHTTPNetworking

A simple declarative builder for your network requests

Installation

Install with SPM 📦

Usage

let requestBuilder = RequestBuilder(baseURL: URL(string: "<some url>")!)

let request: Request<ResponseType> =
    requestBuilder
        .method(.get)
        .basicAuth(login: "login", pass: "pass")
        .headers(["key": "value"])
        .path("endpoint")
        .build()

request.start { result in
    switch result {
    case .success(let response): ()
    case .failure(let error): ()
    }
}

The request holds a strong reference to itself until a response. If you need lifecycle management for your async operations, you can use promises.

Features

  • SSL-pinning
  • Response mocking
  • Support of multiple authorization types. Certificate / OAuth / basic / bearer.
  • Custom coding support. Default is JSONEncoder / JSONDecoder.

License

This project is released under the MIT license.

GitHub

link
Stars: 0
Last commit: 4 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

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