and cant for the life of me get a reference to using Sytem.Json only using Newtonsoft.Json; I am quite new to this but when I try to write an async task it wont recognise Jsonvalue or JsonObject
Get method for logging in
async Task logInAsync(string logInGet)
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(new Uri(logInGet));
request.ContentType = "application/json";
request.Method = "GET";
// Send the request to the server and wait for the response:
using (WebResponse response = await request.GetResponseAsync())
{
// Get a stream representation of the HTTP web response:
using (Stream stream = response.GetResponseStream())
{
// Use this stream to build a JSON document object:
JsonValue jsonDoc = await Task.Run(() => JsonObject.Load(stream));
Console.Out.WriteLine("Response: {0}", jsonDoc.ToString());
// Return the JSON document:
return jsonDoc;
}
}
It just doesnt like Jsonvalue or JsonObject