title: iOS - How to add a custom header field to every request made by my UIWebView
body: <p>I want to add a custom header field to every request made by my UIWebView. First I tried to do this in the "shouldStartLoadWithRequest" method in my controller, but this only works for the first request made - all subsequent requests are not handled by this method.</p>
  
  <p>After some search, I found this tutorial (<a href="http://eng.42go.com/customizing-uiwebview-requests-with-nsurlprotocol/" rel="nofollow">http://eng.42go.com/customizing-uiwebview-requests-with-nsurlprotocol/</a>). So I implemented my own NSURLProtocol subclass, and everthing is working fine, except my login page - there is some problem with authentication, and I could not solve this. I saw that there exists some methods like "canAuthenticateAgainsProtectionSpace" and "didReceiveAuthenticationChallenge", and I probably need to implement these in order to my login page to work. However, this seems a lot of additional work, since in the first place I just wanted to add a field to every request. </p>
  
  <p>So my doubts are: </p>
  
  <ul>
  <li>Is there any other easy way to do this? </li>
  <li>If not, should I implement all these authentication methods?</li>
  <li>Is there a way to my custom NSURLProtocol subclass to extends from something like NSURLHTTPProtocol (therefore I would only have minimal work) instead of the NSURLProtocol itself?</li>
  </ul>
  
  <p>Thanks!</p>