Hello,
I wanted to use UnityWebRequest instead of WWW.
However I got a problem that I didn’t have with WWW. The following code always returns “403, isError is False” on a domain I own.
UnityEngine.Experimental.Networking.UnityWebRequest webRequest = UnityEngine.Experimental.Networking.UnityWebRequest.Get("http://mydomain.thatdoesntwork.com/some_text.txt");
webRequest.Send();
while (!webRequest.isDone) ;
Debug.Log(webRequest.responseCode + ", isError is " + webRequest.isError);
I own another domain, so I tried putting there the same some_text.txt
with the same permissions (644), and it works with that url: httq://myotherdomain.thatworks.org/some_text.txt
I can access both addresses in a browser from the same computer, even in Private mode. The domain that works has a .htaccess, for unrelated redirection; the broken one doesn’t.
The 403 message with isError is False
is always there, no matter what I put after httq://mydomain.thatdoesntwork.com
, an existing file or not. And obviously webRequest.downloadHandler.text
contains the 403 standard page HTML code. With the other domain, I get the correct behavior everytime.
What can I try next?
Thank you if you can help me.
PS: I put httq on purpose to disable links.