ResponseValidator
public struct ResponseValidator<Body, Error> where Error : Error
A value type used to validate a RequestResponse
-
Create a
ResponseValidator
Declaration
Swift
public init(_ handler: @escaping Handler)
Parameters
handler
The closure used to validate
-
Specialized
RequestResponse
that this validator can validateDeclaration
Swift
public typealias Response = RequestResponse<Body>
-
The validation handler
Declaration
Swift
public let validate: Handler
-
An unsafe response validator, which never returns an error, regardless of the content of the response
Declaration
Swift
static var unsafe: `Self` { get }
-
The default response validator for
HTTPError
types, which returns an error based on the status codeDeclaration
Swift
static var `default`: `Self` { get }