Swiftpack.co - creekpld/SimpleHTTP as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by creekpld.
creekpld/SimpleHTTP 1.0.0
A simple library to make HTTP Requests using URLRequest and Codable Data.
⭐️ 0
🕓 2 years ago
.package(url: "https://github.com/creekpld/SimpleHTTP.git", from: "1.0.0")

This is not the Repo you are looking for! :alien:

New development is taking place in gitlab.com/pdylong/SimpleHTTP :ok_hand:.

GitHub tag


A simple library to make HTTP Requests using URLRequest and Codable Data.

This Swift library is written in swift version 4.0


  • ☑ Uses only Foundations URLRequest
  • ☑ Very simple one line HTTP Requets
  • ☑ Supports Swift's Codable Models
  • ☑ Supports Linux


Import Source File

You can just drop the Source File SimpleHTTP.swift into your Project.

Swift Package Manager

// swift-tools-version:4.0

import PackageDescription

let package = Package(
    name: "YourApp",
    products: [
        .executable(name: "YourApp", targets: ["YourApp"]),
    dependencies: [
        .Package(url: "https://github.com/creekpld/SimpleHTTP.git", from: "1.0.0")
    targets: [
            name: "YourApp",
            dependencies: ["SimpleHTTP"],
            path: "Sources"),


Synchronous Example:

import SimpleHTTP

let result = httpSync("https://example.com").json() as YourResultModel?

Asynchronous Example:

    ( data, result, error) as
    let result = data.json() as YourResultModel?
    // your code

Advanced Usage

        let request = YourRequestModel(msg: "Hello", description: "World", version: "1.2.3")
        let result = httpSync("https://example.com/api/v1/", 
                              Data(encode: request),
                               "Authorization":"Bearer UkGaHu8nT4O05XgoEhA50oPbmWxSI0"],
                              timeout: 120
                            )?.json() as YourResultModel?


  • ☑ Code Comments / Documentation
  • ☑ Advanced Usage Examples
  • ☐ Some Tests
  • ☐ CI


SimpleHTTP is available as open source under the terms of the MIT License.


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

Release Notes

3 years ago

Initial Release

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