HPNetwork Documentation Beta

Class Network

public class Network: NSObject
Network Network NSObject NSObject Network->NSObject

Conforms To

NSObject

Properties

shared

let shared

queue

let queue

Methods

data​Task(_:​completion:​)

@discardableResult public func dataTask<T: NetworkRequest>(_ request: T, completion: @escaping (Result<T.Output, Error>) -> Void) -> NetworkTask

upload​Task(_:​data:​completion:​)

@discardableResult public func uploadTask<T: NetworkRequest>(_ request: T, data: Data?, completion: @escaping (Result<T.Output, Error>) -> Void) -> NetworkTask

upload​Task(_:​file​URL:​completion:​)

@discardableResult public func uploadTask<T: NetworkRequest>(_ request: T, fileURL: URL, completion: @escaping (Result<T.Output, Error>) -> Void) -> NetworkTask

download​Task(_:​completion:​)

@discardableResult public func downloadTask<R: NetworkRequest>(_ request: R, completion: @escaping (Result<URL, Error>) -> Void) -> NetworkTask

error(from:​)

static func error(from response: URLResponse?) -> Error?

move​File(from:​to:​)

static func moveFile(from origin: URL, to destination: URL) throws