Skip to content

Instantly share code, notes, and snippets.



Last active May 31, 2016
What would you like to do?
Simple HTTP request. Swift backend implementation
import HTTP
import File
import HTTPSClient
import JSON
var url: String?
do {
let client = try! Client(uri: "")
var response = try client.get("/repos/vsouza/awesome-ios/git/trees/HEAD")
let buffer = try response.body.becomeBuffer()
let parsed = try! JSONParser().parse(data: buffer)
} catch {
print("Response error")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment