Request
public struct Request<T, E> : Requestable where E : Auth0APIError
Auth0 API request.
let request: Request<Credentials, AuthenticationError> = // ...
request.start { result in
print(result)
}
-
The callback closure type for the request.
Declaration
Swift
public typealias Callback = (Result<T, E>) -> Void
-
Performs the request.
Declaration
Swift
public func start(_ callback: @escaping Callback)
Parameters
callback
Callback that receives the result of the request when it completes.
-
Modifies the parameters by creating a copy of the request and adding the provided parameters to
parameters
.Declaration
Swift
public func parameters(_ extraParameters: [String : Any]) -> Request<T, E>
Parameters
extraParameters
Additional parameters for the request.
-
Modifies the headers by creating a copy of the request and adding the provided headers to
headers
.Declaration
Swift
public func headers(_ extraHeaders: [String : String]) -> Request<T, E>
Parameters
extraHeaders
Additional headers for the request.
-
Combine publisher for the request.
Declaration
Swift
func start() -> AnyPublisher<T, E>
Return Value
A type-erased publisher.
-
start()
AsynchronousDeclaration
Swift
func start() async throws -> T