title: Webclient 404 protocol error on valid url c#
body: <p>I have a <code>webclient</code> that calls to a <code>URL</code> that works fine when i view it in a browser, which led me to believe i would need to add headers in to my call</p>
  
  <p>I have done this, but am still getting the error.</p>
  
  <p>I do have other calls to the same API that work fine, and have checked that all the parameters I am passing across are exactly the same as expected(case, spelling)</p>
  
  <pre><code>using (var wb = new WebClient())
  {
      wb.Proxy = proxy;
      wb.Headers.Add("Accept-Language", " en-US");
      wb.Headers.Add("Accept", " text/html, application/xhtml+xml, */*");
      wb.Headers.Add("User-Agent", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"); 
      byte[] response = wb.UploadValues("http://myserver/api/account/GetUser",
                                        new NameValueCollection()
                                        {
                                            { "email", register.Email },
                                        });
      userDetails = Encoding.UTF8.GetString(response);
  } 
  </code></pre>
  
  <p>Does anyone have an idea why I am still getting the protocol error on a call that works perfectly fine in a browser?</p>