Simple synchronous HTTP client in Swift
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Sources
Tests
.gitignore
.swift-version
.travis.yml
LICENSE
Makefile
Package.swift
README.md

README.md

Requests

Simple synchronous HTTP client in Swift.

Usage

let response = try get("http://httpbin.org/get")

print(response.headers)
print(response.body)
let response = try post("http://httpbin.org/post", content: "Hello World")

print(response.headers)
print(response.body)

Missing Features

I wouldn't recommend using this for anything serious, it misses many features. When considering the correct approach, this library probably takes a shortcut.

It misses at least the following:

  • HTTPS (SSL/TLS)
  • IPv6
  • Handling of redirects
  • Dozens of other things

Pull requests are however very welcome if you are interested in adding any of these missing features.