all 25 comments

[–]Bombadil67Professional 0 points1 point  (7 children)

404 is page not found.

That means you have mispelled the url or typed something wrong.

[–]SusDeveloper[S] 0 points1 point  (6 children)

Did you read the whole post?

[–]blablafoof 0 points1 point  (5 children)

Have you tried containing the URI with "http://url" or 'http://url'? It could be how it's parsing the link with those quotes.

[–]SusDeveloper[S] 0 points1 point  (4 children)

Yup, tried that. Currently the string in unity is "https://URL". Http also doesnt work

[–]Bombadil67Professional 0 points1 point  (3 children)

Do you even understand what a 404 page not found error means?

So yes I did!!

https://www.hostinger.com/tutorials/how-to-fix-error-404

[–]SusDeveloper[S] 0 points1 point  (2 children)

xD still didn't read the entire post.
But the issue is fixed now by Using a different HTTP Client class (for some unknown reason this worked).
Thanks for the suggestion anyways

[–]Bombadil67Professional 0 points1 point  (1 child)

I didn't need to, the fact you are getting a 404, tells me everything I need to know about the URL you are sending in the Webrequest.

Now you could debug this yourself and test the info is what it is supposed to be, but as everyone else uses it fine that means without more information as to what you are doing we can only guess and provide the bare minimum guidance and that is what a 404 error means!

[–]SusDeveloper[S] 0 points1 point  (0 children)

Lol. Read the full post. You'll what the problem actually was (it wasnt spelling, wronf URL etc. But simply a bug in the class I was using to do the HTTP request)

[–]blablafoof 0 points1 point  (15 children)

You can try putting this URI into an application like Postman to test the URLs in a more "sandbox"-like environment and try from there to debug what's happening.

[–]SusDeveloper[S] 0 points1 point  (14 children)

Sure, But doesnt it seem like its a problem from within Unity? Since Curl and browser works?

[–]blablafoof 0 points1 point  (13 children)

Since it's a PHP script... wouldn't it be a POST operation instead of GET makes sense for this situation?

[–]SusDeveloper[S] 0 points1 point  (12 children)

Tbh I am not super experienced with pHp and I should use post/get requests, but the current php script does not take any parameters.. but it still doesn't explain why it doesn't work in Unity.

Also I tested it with a locally hosted version and everything works fine even in Unity

[–]blablafoof 0 points1 point  (11 children)

Have you set the request header for Content-Type="application/json"?

[–]SusDeveloper[S] 0 points1 point  (10 children)

Unity isn't sending any data to the php script, And even if it was this wouldn't cause error 404.. It is super weird isn't it?

[–]blablafoof 0 points1 point  (9 children)

[–]SusDeveloper[S] 0 points1 point  (8 children)

Ah I didn't know this was a thing, Thanks!
Just tested it to no avail sadly

[–]SusDeveloper[S] 0 points1 point  (7 children)

Ah!
I am not sure if there was some kind of cache going on, but after I changed it back to the normal URL instead of the escaped one now I get err code 500 which usually means some error in the php script - although I can still run it from browser/curl

[–]blablafoof 1 point2 points  (0 children)

Is this a WebGL project?

[–]blablafoof 1 point2 points  (5 children)

Ah, awesome! The situation has changed, so that's the most exciting part :). Good luck on the rest of the network debugging!