The question is answered, right answer was accepted
WWW Error : 404 with working url
Hi there. Can't get out of my 404 error !
My php request works fine in editor, but when I build ( Webgl ), it returns me a 404 Not Found ( the url is still correct in the log )
my code can't be easier, I call this coroutine :
public IEnumerator WaitRequest( WWW request, Risque[] risques)
{
yield return request;
// check for errors
if (request.error == null)
{
Debug.Log(request.url + "WWW Ok!: " + request.text);
}
else {
Debug.Log(request + " url " +request.url+ " WWW Error: " + request.error);
}
yield return null;
}
Editor return the response, the build return " WWW Error: 404 Not Found " both in Chrome and Mozzila.
Any ideas ? Thanks in advance !
Ok little update : Found in my console that my request was modified ( and i don't not why ) to something like : htp://Adresse/ShouldNot/Be/Added/ MyGoodUrl
So my url is good in the log but when the request is launched the address of the current page is added before my url .... And the 404 is logical....
Why is my request modified ?
Answer by Trusty · Jun 06, 2017 at 08:54 AM
Resolved : Response was in the doc, just put // before the url.
Fun fact is I put them firs time but \\ don't work in editor so I removed them ... Ayem !
Follow this Question
Related Questions
Unity WebGL build and PHP Post communication 0 Answers
WWW Class silent crach 1 Answer
i need help unity get data from php 0 Answers
WebGL/WebSocket has stopped while processing WWW.LoadFromCacheOrDownload 0 Answers
consume a php webservice in Unity3D C# 2 Answers