I have a simple piece of code that sends out a Tweet. Keeping the message with the % signs in it causes a 401 Unauthorized error:
class Program
{
static void Main(string[] args)
{
var test = new TwitterService("ConsumerKey", "ConsumerSecret", "Token", "TokenSecret");
try
{
// "Test 1, So, I know there's no #inflation and so on...but the 10y inflation swap just went to 2.80%. 5y CPI 5y forward is 3.15%. Hmmm."
test.SendTweet(WebUtility.HtmlEncode("Test 3, So, I know there's no #inflation and so on...but the 10y inflation swap just went to 2.80%. 5y CPI 5y forward is 3.15. Hmmm."));
}
catch (Exception ex)
{
if (ex.Message.Equals(""))
{
}
}
}
}
If I send the same message through TweetDeck or directly using the Twitter page, it posts with no problems. Any ideas?