HPNetwork Documentation Beta

Protocol Network​Request

public protocol NetworkRequest

A protocol to wrap request objects. This gives us a better API over URLRequest.

NetworkRequest NetworkRequest ImageDownloadRequest ImageDownloadRequest ImageDownloadRequest->NetworkRequest DecodableRequest DecodableRequest DecodableRequest->NetworkRequest

Types Conforming to Network​Request

DecodableRequest
ImageDownloadRequest

Requirements

Output

associatedtype Output

url​Request()

func urlRequest() -> URLRequest?

Generates a URLRequest from the request. This will be run on a background thread so model parsing is allowed.

finishing​Queue

var finishingQueue: DispatchQueue

url

var url: URL?

request​Method

var requestMethod: NetworkRequestMethod

authentication

var authentication: NetworkRequestAuthentication?

url​Session

var urlSession: URLSession

convert​Response(response:​)

func convertResponse(response: NetworkResponse) throws -> Output