I am trying to access the delicious API and decided to start using the RestSharp library for the calls. My test code looks like this:
var client = new RestClient("https://api.del.icio.us/");
client.Authenticator = new HttpBasicAuthenticator("username", "password");
client.UserAgent = "my_user_agent";
var request = new RestRequest("v1/tags/get");
client.ExecuteAsync(request, response =>
{
if (response.ResponseStatus == ResponseStatus.Error)
{
Dispatcher.BeginInvoke(() =>
{
MessageBox.Show(response.ErrorMessage);
});
}
else if (response.ResponseStatus == ResponseStatus.Completed)
{
Dispatcher.BeginInvoke(() =>
{
MessageBox.Show(response.Content);
});
}
});
For this code the delicious API returns "access denied" code although my username and password used in the code are correct. I suspect that I may be doing something wrong with RestSharp as I just started using this library. Can anyone help me with the code above? What am I doing wrong?