I am trying to pass a string formatted as XML to a Web Api controller, and when it is sent, it only receives the string up to the first &
symbol, and then cuts off. Is there any way to make sure the &
symbols will not escape the string?
Here is an example of my request:
string result = "";
using (var client = new WebClient())
{
client.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
string allLines = "=" + param.ToString();
result = client.UploadString(url, "POST", allLines);
}
return result;