I would like to convert my response from the NSHTTPURLResponse type to String:
let task = session.dataTaskWithRequest(request, completionHandler: {(data, response, error) -> Void in
println("Response: \(response)")
var responseText: String = String(data: response, encoding: NSUTF8StringEncoding)
})
The line below outputs the response message to the console.
println("Response: \(response)")
But this line renders me an error: Extra argument 'encoding' in Call.
var responseText: String = String(data: response, encoding: NSUTF8StringEncoding)
How can I successfully convert this "response" into a String?