OAuth2DataTaskRequestPerformer
open class OAuth2DataTaskRequestPerformer: OAuth2RequestPerformer
Simple implementation of OAuth2RequestPerformer
, using URLSession.dataTask()
to perform requests.
-
The URLSession that should be used.
Declaration
Swift
public var session: URLSession
-
Designated initializer.
Declaration
Swift
public init(session: URLSession)
-
This method should start executing the given request, returning a URLSessionTask if it chooses to do so. You do not neet to call
resume()
on this task, it’s supposed to already have started. It is being returned so you may be able to do additional stuff.Declaration
Swift
open func perform(request: URLRequest, completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionTask?
Parameters
request
An URLRequest object that provides the URL, cache policy, request type, body data or body stream, and so on.
completionHandler
The completion handler to call when the load request is complete.
Return Value
An already running session data task