Response.swift

struct Response {
    let data: NSData
    var statusCode: Int = 500

    init(data: NSData, urlResponse: NSURLResponse) {
        self.data = data
        if let httpResponse = urlResponse as? NSHTTPURLResponse {
            statusCode = httpResponse.statusCode
        }
    }
}

你可能感兴趣的:(Response.swift)