Quantcast
Channel: Questions in topic: "get"
Viewing all articles
Browse latest Browse all 215

See Request of WWW or UnityWebRequest, 403 error only from android in a specific url (GET)

$
0
0
Hello, I have a code that downloads data from a url. I have a problem that one Url gives me error 403 (Forbidden) only from android. When i get the url from editor or Windows build, all works perfectly. So if i could see the Request that WWW or UnityWebRequest does from android and Windows i would be able to compare whats going wrong. I tested it with two codes ( WWW and UnityWebRequest) and both give the same result. i tested it with other urls that contains xml, and it works. Url: http://www.mambiente.madrid.es/opendata/horario.xml WWW IEnumerator DownloadXml(string url, DateTime data = new DateTime()) { WWW www = new WWW(url); yield return www; ParseXML text = new ParseXML(); string file = www.text; UnityWebRequest IEnumerator GetRequest(string url, DateTime data, bool actualPolution) { using (UnityWebRequest webRequest = UnityWebRequest.Get(url)) { // Request and wait for the desired page. yield return webRequest.SendWebRequest(); if (webRequest.isNetworkError) { Debug.Log(url + ": Error: " + webRequest.error); } else { ParseXML text = new ParseXML(); string file = webRequest.downloadHandler.text; Debug.Log(url + ":\nReceived: " + file);

Viewing all articles
Browse latest Browse all 215

Trending Articles



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