title: HttpClient PostAsync Parameter Incorrect
body: <p>I just deployed Windows 10 64-bit Education on my Macbook Air, a slightly updated installer from my main development PC which also runs Windows 10 64-bit Education.</p>
  
  <p>I've installed Visual Studio 2017 and downloaded all of the nugget packaged for my project solution, exactly how I've done it on my development PC.</p>
  
  <p>My problem is when I run production code that we use all the time inhouse and have received no complaints from our clients, it doesn't work on my new setup / installation.</p>
  
  <p>We have a method to login users with a simple username and password field. When we call a PostAsync method it sends up the form data to our servers. I've used Postman and have received a correct response. The code hasn't been modified or changed at all and is known working code. I'm also working off coffee shop and home wife, which is the only difference. I haven't tried getting this to work in the office yet. Out clients go to coffee shops and use home wifi all the time..</p>
  
  <p>Any thoughts and suggestions would be greatly appreciated</p>
  
  <p><strong>Vague Exception - but my code hasn't changed at all?</strong></p>
  
  <pre><code>{System.ArgumentException: The parameter is incorrect.
  The parameter is incorrect.
  at Windows.Web.Http.HttpClient.PostAsync(Uri uri, IHttpContent content)
  at CoreProject.Helpers.LogginHelper.&lt;UserLogin&gt;d__1.MoveNext()}
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>URI setup code</p>
  
  <pre><code>Uri uri = new URI("https://oururi.com/login");
  </code></pre>
  
  <p>HttpClient setup code</p>
  
  <pre><code>// disable caching
  // https://social.msdn.microsoft.com/Forums/en-US/79e98534-5d8e-4879-acbe-7a457ee2a7ad/windowswebhttphttpclient-turn-off-caching?forum=winappswithcsharp
  var RootFilter = new HttpBaseProtocolFilter();
  RootFilter.CacheControl.ReadBehavior = HttpCacheReadBehavior.NoCache;
  RootFilter.CacheControl.WriteBehavior = HttpCacheWriteBehavior.NoCache;
  
  HttpClient httpClient = new HttpClient(RootFilter);
  httpClient.DefaultRequestHeaders.Add("email", email);
  httpClient.DefaultRequestHeaders.Add("pw", password);
  httpClient.DefaultRequestHeaders.Add("apiVersion", "2.0");
  httpClient.DefaultRequestHeaders.Add("version", CacheHelper.getVersionString());
  httpClient.DefaultRequestHeaders.Add("appID", CacheHelper.Config.AppId());
  httpClient.DefaultRequestHeaders.Add("platform", "windows");
  httpClient.DefaultRequestHeaders.Add("updated", LocalSettingsHelper.GetContentLastUpdatedTimestamp());
  httpClient.DefaultRequestHeaders.Add("bundleID", CacheHelper.Config.BundleId());
  httpClient.DefaultRequestHeaders.Add("vendorID", Windows.System.UserProfile.AdvertisingManager.AdvertisingId);
  httpClient.DefaultRequestHeaders.Add("deviceType", UtilityHelper.DeviceType());
  httpClient.DefaultRequestHeaders.Add("osVersion", AnalyticsInfo.VersionInfo.DeviceFamilyVersion);
  
  String termsValue = didAcceptTerms ? "1" : "0";
  httpClient.DefaultRequestHeaders.Add("terms", termsValue);
  return httpClient;
  </code></pre>
  
  <p>Method call that throws the exception</p>
  
  <pre><code> HttpResponseMessage response = await httpClient.PostAsync(uri, null);
  </code></pre>