title: Handle HTTP error with NSURLSession?
body: <p>I'm trying to send a HTTP request with <code>NSURLSession</code>. It works fine, but when the server doesn't respond I can't find where the HTTP error code is stored. The third parameter of <code>completionHandler</code> is just a very general <code>NSError</code>. I read the reference of <code>NSURLResponse</code> but found nothing.</p>
  
  <pre><code>NSURLSessionDataTask *dataTask =
      [session dataTaskWithRequest:[self postRequestWithURLString:apiEntry parameters:parameters]
           completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
               if(!error) NSLog([[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);    
           }
      ];
  [dataTask resume];
  </code></pre>