PCHTTP (https://github.com/pcperini/PCHTTP), implemented in Swift