首页 > 代码库 > SwiftHTTP request.GET中如何return true or false

SwiftHTTP request.GET中如何return true or false

var request = HTTPTask()request.GET("http://vluxe.io", parameters: nil, success: {(response: HTTPResponse) in    if response.responseObject != nil {        let data = response.responseObject as NSData        let str = NSString(data: data, encoding: NSUTF8StringEncoding)        println("response: \(str)") //prints the HTML of the page        // 比如这里我想写个if 然后返回true or false       // 但会得到错误 Type ‘Void‘ does not conform to protocol ‘BooleanLiteralConvertible‘    }},failure: {(error: NSError, response: HTTPResponse?) in    println("error: \(error)")})

SwiftHTTP request.GET中如何return true or false