Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

I am using xamarin forms in visual studio

$
0
0

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


Viewing all articles
Browse latest Browse all 75885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>