Hi,
I'm developing a simple news application for WP7 using Caliburn.Micro. I would like to use Restsharp for rest services.
In my viewmodel I create a new instance of class that uses restsharp.
Then I call LoadData-method in above intance.
Restsharp code is as follows:
client = new RestClient();
client.BaseUrl = "http://www.choomba.org/motocross/kisat.txt";
client.AddHandler("text/plain", new JsonDeserializer());
Debug.WriteLine("requesting from: " + client.BaseUrl);
client.CookieContainer = new CookieContainer();
var request = new RestRequest(Method.GET);
request.AddParameter("rnd", DateTime.Now.Ticks);
request.RequestFormat = DataFormat.Json;
//request.OnBeforeDeserialization = resp => resp.ContentType = "text/json";
Debug.WriteLine("kisat webservice execute async");
//var asyncHandle = client.ExecuteAsync(request, Callback);
client.ExecuteAsync(request, response =>
{
RestResponse resourse = (RestResponse)response;
Debug.WriteLine(response.ResponseStatus);
});
Problem is that ResponseStatus is always Error.
What gives? What am I doing wrong here?
Br,
Ville