OAuth2RequestPerformer
public protocol OAuth2RequestPerformer
Protocol for types that can perform URLRequest
s.
The class OAuth2DataTaskRequestPerformer
implements this protocol and is by default used by all OAuth2
classes to perform requests.
-
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
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 task