RequestSerializer
The protocol that request serializers must adhere to.
-
The url that this request serializer is bound to.
Declaration
Swift
var url: NSURL? { get set }
-
Any headers that will be appended on the request.
Declaration
Swift
var headers: [String: String]? { get set }
-
The String encoding to be used.
Declaration
Swift
var stringEncoding: NSNumber { get }
-
The cache policy.
Declaration
Swift
var cachePolicy: NSURLRequestCachePolicy { get }
-
The timeout interval.
Declaration
Swift
var timeoutInterval: NSTimeInterval { get set }
-
Build an request using the specified params passed in.
Declaration
Swift
func request(url: NSURL, method: HttpMethod, parameters: [String: AnyObject]?, headers: [String: String]?) -> NSURLRequest
Parameters
url
the url of the resource.
method
the method to be used.
parameters
the request parameters.
headers
any headers to be used on this request.
Return Value
the URLRequest object.
-
Build an multipart request using the specified params passed in.
Declaration
Swift
func multipartRequest(url: NSURL, method: HttpMethod, parameters: [String: AnyObject]?, headers: [String: String]?) -> NSURLRequest
Parameters
url
the url of the resource.
method
the method to be used.
parameters
the request parameters.
headers
any headers to be used on this request.
Return Value
the URLRequest object