title: iPhone URL Request: Add value to HTTP header field
body: <p>I'm trying to add a value to the header for a URL request. </p>
  
  <p>Something like this works just fine:</p>
  
  <pre><code>[urlRequest addValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"];
  </code></pre>
  
  <p>But this doesn't even show up in the header:</p>
  
  <pre><code>NSString *authString = [[NSString alloc] initWithString:
                            [defaults objectForKey:@"auth"]];
  [urlRequest addValue:authString forHTTPHeaderField:@"iphoneID"];
  </code></pre>
  
  <p>I'm completely stumped. The auth string is around 90 characters long. Is this a problem?</p>
  
  <p><em>Edit:</em>
  Here's the code I'm trying:</p>
  
  <pre><code>NSString *authString = [[NSString alloc] initWithString:[defaults objectForKey:@"auth"]]; 
  [urlRequest addValue:authString forHTTPHeaderField:@"iphoneid"]; 
  [urlRequest addValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"]; 
  </code></pre>
  
  <p>I can see the Accept-Encoding header being sent through Wireshark, but iphoneid is nowhere to be found. It's just a string, 80-90 characters long.</p>
  
  <p><em>Another Update:</em>
  So it seems that the problem isn't the field "iphoneid" but rather the authString I'm trying to pass into it. Other strings that I just create with the @"something" work fine, but the auth string that I pull from NSUserDefaults doesn't appear.</p>
  
  <p>Suggestions on how to debug this?</p>