WebClient Add Authorization
<p>I am trying to post to a REST web service in order to update new stock prices. I am facing an error each time i post the URL in the code using <code>WebClient</code>. The remote server has a Bad Request(400). Each time I'm trying to post the parameters I get the Bad Request(400) error. The webservice requires a header with an api key which is the parameter  key in the method signature.</p>

<pre><code>public string CompanyService(string key, string c, string pc, string po, string ph, string pl, string pb, string pv, string pd, string pt)
{
    string SmsStatusMsg = string.Empty;
    try
    {

        WebClient client = new WebClient();
        string URL = "";

        URL = "http://166.63.10.232:88/finsec/api/v1/setCompanyPrices";

        string data = "company_name=" + c + "&amp;price_close=" + pc + "&amp;price_open=" + po + "&amp;price_high=" + ph + "&amp;price_low=" + pl + "&amp;price_best=" + pb + "&amp;price_volume=" + pv + "&amp;price_date=" + pd + "&amp;price_time=" + pt +"";

        client.Headers.Add("Authorization", "Bearer " + key);

        SmsStatusMsg = client.UploadString(URL, "POST", data);

        if (SmsStatusMsg.Contains("&lt;br&gt;"))
        {
            SmsStatusMsg = SmsStatusMsg.Replace("&lt;br&gt;", ", ");
        }
    }
    catch (WebException e1)
    {
        SmsStatusMsg = e1.Message;
    }
    catch (Exception e2)
    {
        SmsStatusMsg = e2.Message;
    }
    return SmsStatusMsg;
}
</code></pre>