I\'m trying to send a HTTP request with NSURLSession. It works fine, but when the server doesn\'t respond I can\'t find where the HTTP error code is stored. The
NSURLSession
If server-side error occurred data parameter from completion handler may contain some useful info
data
In general I thin you should implement URLSession:task:didCompleteWithError: from NSURLSessionTaskDelegate protocol in session delegate
URLSession:task:didCompleteWithError:
NSURLSessionTaskDelegate
docs: NSURLSessionTaskDelegate Protocol Reference