我正在尝试发送一个简单的HTTP请求:
var client = new WebClient();
string myString="this is the string i want to send";
message = client.DownloadString("http://www.viralheat.com/api/sentiment/review.xml?text=" + myString + "&api_key="+currentKey);
但我发送的一些字符串包括#或&或者这样的字符,所以我想在发送之前先对字符串进行编码,因为如果它包含这些特殊字符而不进行编码就会引发错误。