Quantcast
Viewing all articles
Browse latest Browse all 215

I cant get response json from rest call in Unity

Hi all, I had a problem while using www class for rest calls. I wrote the following code. void Start () { WWW www = new WWW ("http://ip.jsontest.com/"); StartCoroutine(WaitForRequest (www)); } private IEnumerator WaitForRequest(WWW www) { yield return www; // check for errors if (www.error == null) { print (www.text); } else { print ("error: "+www.error); } } "http://ip.jsontest.com/" this url returns simple json that shows an ip. Ex: { "ip": "193.202.18.14" } But I didnt get that json in unity. What i get is below. IIS Windows Server
Image may be NSFW.
Clik here to view.
IIS
UnityEngine.MonoBehaviour:print(Object)c__Iterator0:MoveNext() (at Assets/ApplicationController.cs:56) UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) I have read many documents and I have tried many solutions but I couldn't solve it. How could i get that json? Thanks,

Viewing all articles
Browse latest Browse all 215

Trending Articles



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