<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jsonutility Archives - Oxmond Technology</title>
	<atom:link href="https://oxmond.com/tag/jsonutility/feed/" rel="self" type="application/rss+xml" />
	<link>https://oxmond.com</link>
	<description>IT Development</description>
	<lastBuildDate>Wed, 18 Nov 2020 03:47:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0</generator>
	<item>
		<title>How to read JSON data from a web service in C#</title>
		<link>https://oxmond.com/how-to-read-json-data-from-a-web-service-in-c/</link>
					<comments>https://oxmond.com/how-to-read-json-data-from-a-web-service-in-c/#comments</comments>
		
		<dc:creator><![CDATA[Oxmond Technology]]></dc:creator>
		<pubDate>Tue, 17 Sep 2019 13:05:52 +0000</pubDate>
				<category><![CDATA[C# Lesson]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Unity]]></category>
		<category><![CDATA[2019]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[coding pirates]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[Hans Oxmond]]></category>
		<category><![CDATA[Henrik Poulsen]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[How to get JSON data from a web service in Unity]]></category>
		<category><![CDATA[How to read a JSON file in Unity]]></category>
		<category><![CDATA[How to read JSON data from a web service in C#]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[Import JSON file]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[json file]]></category>
		<category><![CDATA[json list]]></category>
		<category><![CDATA[json object]]></category>
		<category><![CDATA[json parser]]></category>
		<category><![CDATA[jsonobject]]></category>
		<category><![CDATA[jsonutility]]></category>
		<category><![CDATA[learn]]></category>
		<category><![CDATA[lesson]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[loading]]></category>
		<category><![CDATA[Oxmond Unity Tutorials]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[read]]></category>
		<category><![CDATA[reading]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[SimpleJSON]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Unity3d]]></category>
		<category><![CDATA[video games]]></category>
		<category><![CDATA[web]]></category>
		<guid isPermaLink="false">https://oxmond.com/?p=608</guid>

					<description><![CDATA[<p>How to read a JSON data from a web service in Unity. This Tutorial is about reading JSON data. We will build a little application build on a JSON webservice. ✅ Download the free SimpleJSON parser: https://github.com/HenrikPoulsen/SimpleJSON ✅ The free geoplugin webservice: http://www.geoplugin.net/json.gp?ip=213.22.22.98 ❤️ Subscribe...</p>
<p>The post <a rel="nofollow" href="https://oxmond.com/how-to-read-json-data-from-a-web-service-in-c/">How to read JSON data from a web service in C#</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>How to read a JSON data from a web service in Unity. This Tutorial is about reading JSON data. We will build a little application build on a JSON webservice.</p>
<hr />
<p>✅ Download the free SimpleJSON parser:<br />
<a href="https://github.com/HenrikPoulsen/SimpleJSON">https://github.com/HenrikPoulsen/SimpleJSON</a></p>
<p>✅ The free geoplugin webservice:<br />
<a href="http://www.geoplugin.net/json.gp?ip=213.22.22.98">http://www.geoplugin.net/json.gp?ip=213.22.22.98</a></p>
<hr />
<p>❤️ Subscribe to Oxmond Tutorials. New tutorials every day! Stay tuned!<br />
<a href="https://bit.ly/SubscribeOxmondTutorials">https://bit.ly/SubscribeOxmondTutorials</a></p>
<p>🔔 Remember to hit that little bell to turn on notifications!</p>
<p>😷👕 Need a face mask / developer T-shirt? Drop by our shop and get a 20% DISCOUNT on your first purchase by using the discount code OXMONDSALE. Click here:<br />
<a href="https://shop.oxmond.com/discount/OXMONDSALE">https://shop.oxmond.com/discount/OXMONDSALE</a></p>
<hr />
<p>✅ Download free assets from the Unity Assets Store for your game:<br />
<a href="https://assetstore.unity.com/lists/top-free-packages-13201?aid=1100l4p9k">https://assetstore.unity.com/lists/top-free-packages-13201?aid=1100l4p9k</a></p>
<hr />
<p><strong>The LoadJSON script:</strong></p>
<pre>/*

   .-------.                             .--.    .-------.     .--.            .--.     .--.        
   |       |--.--.--------.-----.-----.--|  |    |_     _|--.--|  |_.-----.----|__|---.-|  |-----.
   |   -   |_   _|        |  _  |     |  _  |      |   | |  |  |   _|  _  |   _|  |  _  |  |__ --|
   |_______|__.__|__|__|__|_____|__|__|_____|      |___| |_____|____|_____|__| |__|___._|__|_____|
   © 2019 OXMOND / www.oxmond.com 

*/

using System.Collections;
using UnityEngine;
using SimpleJSON;
using UnityEngine.Networking;
using TMPro;

public class LoadJSON : MonoBehaviour
{

    public TMP_InputField inputTxt;
    public TMP_Text countryTxt;
    public TMP_Text continentTxt;

    public void GetJsonData()
    {
        StartCoroutine(RequestWebService());
    }

    IEnumerator RequestWebService()
    {
        string getDataUrl = "http://www.geoplugin.net/json.gp?ip=" + inputTxt.text;
        print(getDataUrl);

        using (UnityWebRequest webData = UnityWebRequest.Get(getDataUrl))
        {

            yield return webData.SendWebRequest();
            if (webData.isNetworkError || webData.isHttpError)
            {
                print("---------------- ERROR ----------------");
                print(webData.error);
            }
            else
            {
                if (webData.isDone)
                {
                    JSONNode jsonData = JSON.Parse(System.Text.Encoding.UTF8.GetString(webData.downloadHandler.data));

                    if (jsonData == null)
                    {
                        print("---------------- NO DATA ----------------");
                    }
                    else
                    {
                        print("---------------- JSON DATA ----------------");
                        print("jsonData.Count:" + jsonData.Count);
                        countryTxt.text = jsonData["geoplugin_countryName"];
                        continentTxt.text = jsonData["geoplugin_continentName"];
                    }
                }
            }
        }
    }
}

</pre>
<p>The post <a rel="nofollow" href="https://oxmond.com/how-to-read-json-data-from-a-web-service-in-c/">How to read JSON data from a web service in C#</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://oxmond.com/how-to-read-json-data-from-a-web-service-in-c/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
