[Mono-list] TweetSharp Failing
Abe Gillespie
abe.gillespie at gmail.com
Sat Mar 27 00:26:41 EDT 2010
The bug report: https://bugzilla.novell.com/show_bug.cgi?id=591633
The test case just in case you're curious. As always, this one's show
stopping me. ;)
using System;
using System.Net;
using System.IO;
using System.Text;
namespace Tester
{
class Program
{
static void Main(string[] args)
{
try
{
var req = WebRequest
.Create("http://api.twitter.com/1/direct_messages/sent.json");
req.Method = "GET";
req.PreAuthenticate = true;
req.Headers["Authorization"] =
ToBasicAuthorizationHeader("twitter-user", "password");
var stream = req.GetResponse().GetResponseStream();
Console.WriteLine("Windows: WIN");
}
catch
{
Console.WriteLine("Mono: FAIL");
}
}
public static string ToBasicAuthorizationHeader(
string username, string password)
{
var bytes = Encoding.ASCII.GetBytes(
string.Format("{0}:{1}", username, password));
var token = Convert.ToBase64String(bytes);
return string.Format("Basic {0}", token);
}
}
}
On Wed, Mar 3, 2010 at 7:06 PM, Miguel de Icaza <miguel at novell.com> wrote:
>
>> Please let me know if this is a bug and I'll file a report with a test
>> case using TweetSharp.
>
> The smaller the test case, the better.
>
> Please file the most simple program (ideally without a dependency on
> TweetSharp) that will show the failure on Mono, but success on Windows.
>
> miguel
>
>
More information about the Mono-list
mailing list