OAuth2Response
open class OAuth2ResponseEncapsulates a URLResponse to a URLRequest.
Instances of this class are returned from OAuth2Requestable calls, they can be used like so:
perform(request: req) { response in
    do {
        let data = try response.responseData()
        // do what you must with `data` as Data and `response.response` as HTTPURLResponse
    }
    catch let error {
        // the request failed because of `error`
    }
}
- 
                  
                  The data that was returned. DeclarationSwift open var data: Data?
- 
                  
                  The request that generated this response. DeclarationSwift open var request: URLRequest
- 
                  
                  The underlying HTTPURLResponse. DeclarationSwift open var response: HTTPURLResponse
- 
                  
                  Error reported by the underlying mechanisms. DeclarationSwift open var error: Error?
- 
                  
                  Designated initializer. DeclarationSwift public init(data: Data?, request: URLRequest, response: HTTPURLResponse, error: Error?)ParametersdataData that was returned requestThe request to which we responded responseThe HTTPURLResponseto be represented by this instanceerrorError that occurred when handling our request 
- 
                  
                  Throws errors if something with the request went wrong, noop otherwise. You can use this to quickly figure out how to proceed in request callbacks. If data is returned but the status code is >= 400, nothing will be raised except if there’s a 401 or 403. Throws Specific OAuth2Errors (.requestCancelled, .unauthorizedClient, .noDataInResponse) or any Error returned from the requestDeclarationSwift open func responseData() throws -> DataReturn ValueResponse data 
- 
                  
                  Uses responseData(), then decodes JSON usingFoundation.JSONSerializationon the resulting data (if there was any).Throws Any error thrown byresponseData(), plus .jsonParserError if JSON did not decode into[String: Any]DeclarationSwift open func responseJSON() throws -> OAuth2JSONReturn ValueOAuth2JSON on success 
 View on GitHub
            View on GitHub
           Install in Dash
            Install in Dash
           OAuth2Response Class Reference
      OAuth2Response Class Reference