Index

RBURLRequestBuilder.swift

Enumerations

Classes


RBURLRequestBuilder

A convenience URLRequest builder class.

Properties

A convenience URLRequest builder class.
public var url URL { get }

public var body Data? { get set }

public var headers String]() { get set }

public var queries String]() { get set }

public var method RBNetworkRequestMethod { get set }

Functions

public func addPath(_ path: String) -> RBURLRequestBuilder

public func method(_ method: RBNetworkRequestMethod) -> RBURLRequestBuilder

public func contentType(_ type: RBMimeType) -> RBURLRequestBuilder

public func accept(_ type: RBMimeType) -> RBURLRequestBuilder

Adds a new header value.
@param value : The header value.
@param name : The header name.
@returns The request builder so that you can continue to call methods.
public func addHeader(_ value: String, _ name: String) -> RBURLRequestBuilder

Sets the headers.
@param params : The headers.
@returns The request builder so that you can continue to call methods.
public func headers(_ params: [String : String]) -> RBURLRequestBuilder

Adds a new query parameter.
@param value : The query value.
@param name : The query name.
@returns The request builder so that you can continue to call methods.
public func addParameter(_ value: String, _ name: String) -> RBURLRequestBuilder

Sets query parameters.
@param params : The parameters
@returns The request builder so that you can continue to call methods.
public func parameters(_ params: [String : String]) -> RBURLRequestBuilder

Sets body data.
@param data : The data.
@returns The request builder so that you can continue to call methods.
public func body(data: Data) -> RBURLRequestBuilder

Sets body data.
@param json : The json object.
@returns The request builder so that you can continue to call methods.
public func body(_ json: RBJsonObject) -> RBURLRequestBuilder

Sets body data.
@param json : The json dictionary.
@returns The request builder so that you can continue to call methods.
public func body(_ json: [String: Any?]) -> RBURLRequestBuilder

public func createURL() -> URL

public func create() -> URLRequest