title: Download PDF via UIWebView
body: <p>I have a <code>UIWebView</code> that loads a PDF using Basic Auth like so</p>
  
  <pre><code>NSURL* url = [[NSURL alloc] initWithString:_urlString];
  NSString *authStr = [NSString stringWithFormat:@"%@:%@", usr, pwd];
  NSData *authData = [authStr dataUsingEncoding:NSASCIIStringEncoding];
  NSString *authValue = [NSString stringWithFormat:@"Basic %@", [authData base64EncodedStringWithOptions:NSDataBase64Encoding76CharacterLineLength]];
  NSMutableURLRequest *mutableRequest = [[NSMutableURLRequest alloc] initWithURL:url];
  [mutableRequest setValue:authValue forHTTPHeaderField:@"Authorization"];
  [_webView loadRequest:mutableRequest];
  </code></pre>
  
  <p>Is there a way for me to easily save this PDF file onto disk? I've tried this but failed:</p>
  
  <pre><code>NSData *fileData = [[NSData alloc] initWithContentsOfURL:_webView.request.URL];
  </code></pre>
  
  <p>My URL looks like this: <code>www.domain.com/files/foo.pdf</code></p>