title: Setting the HTTP headers for an iOS MobileFirst ResourceRequest adapter call fails
body: <p>I have a customer who is using Xamarin to connect to MobileFirst v7.1 adapters - they are using the latest Xamarin SDK v7.1.</p>
  
  <p>They are using the following code to connect to the adapter and they need to append some information in the headers.  This is working fine when they execute the code for an Android environment, but when they use the same code for iOSv9.1 the .SetHeader() calls throw exceptions.</p>
  
  <pre><code>var uri = new Uri(_worklightClient.ServerUrl + "/adapters/someAction");
  var request = _worklightClient.ResourceRequest(uri, "GET");
  
  #The following code works fine for Android BUT not for iOS9.1
  #if __ANDROID__
      request.SetHeader(new KeyValuePair&lt;string, string&gt;("user", "mobileTesterOne"));
      request.SetHeader(new KeyValuePair&lt;string, string&gt;("env", "build"));
  #endif
  
  #To get it to work for iOSv9.1 this code works, but is it correct?
  #if __IOS__
      WLClient.SharedInstance.AddGlobalHeader("user", "mobileTesterOne");
      WLClient.SharedInstance.AddGlobalHeader("env", "build");
  #endif
  
  var response = await request.Send();
  </code></pre>
  
  <p>The have discovered that for the iOSv9.1 environment, if they use the WLClient.SharedInstance.AddGlobalHeader() calls it works.  But, this is a workaround and they are concerned that this is not the correct way to perform this task and are unsure if using this method is going to cause other, currently unknown issues.</p>
  
  <p>After checking the Infocenter, I see that it mentions using .SetHeader() for the request object, so in theory they were doing it correctly:
  <a href="http://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.1.0/com.ibm.worklight.apiref.doc/html/refjavascript-client/html/WLResourceRequest.html?cp=SSHS8R_7.1.0%2F10-0-0-1-30" rel="nofollow">http://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.1.0/com.ibm.worklight.apiref.doc/html/refjavascript-client/html/WLResourceRequest.html?cp=SSHS8R_7.1.0%2F10-0-0-1-30</a></p>
  
  <p>Does anyone have any advice on the best way to proceed?</p>