I know that if you want to POST a variable to Web API with WebClient you do not include the parameter key
using (WebClient client = new WebClient())
{
string URI = "http://blablabla/api/testaction";
string myParameters = "=TEST";
using (WebClient wc = new WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
string HtmlResult = wc.UploadString(URI, myParameters);
}
}
My question is why can't you include the parameter key?
string myParameters = "myParam=TEST"; // doesn't work
What do you do if you want to pass more than one parameter?