title: iOS: Send If Modified Since header with request
body: <p>Does anyone know how to send If Modified Since header with a url request?</p>
  
  <p>I'm trying to get a status code back that will tell me if an RSS page has been updated or not.</p>
  
  <p>UPDATE #1:
  I was able to do a test doing the following: </p>
  
  <pre><code>NSURL *url = [NSURL URLWithString:self.url];
  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
  [request addValue:@"Tue, 18 Nov 2014 20:46:46 GMT" forHTTPHeaderField:@"If-Modified-Since"];
  [NSURLConnection sendAsynchronousRequest:request queue:queue completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
      NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
  
      int responseCode = (int)[httpResponse statusCode];
      NSLog(@"All headers: %@", [httpResponse allHeaderFields]);
      NSLog(@"Status code:: %d", responseCode);
  }];
  </code></pre>
  
  <p>What's weird though, if I delete my entire iOS application and run it I get the 304 status code. But, if I comment out the line where I add the If-Modified-Since value and re-run it -- then I get the 200 but when I uncomment that line and re-run it -- then the 304 error doesn't come back... It's a 200 error code. The only way to get the 304 error back is by deleting the entire application off my iPhone device.</p>
  
  <p>Any ideas what's going on?</p>