Why is Unity Web Request getting a '406 Not acceptable' error returned after calling for time from a php script?
I have a very basic php script sitting on my personal web server:
And I am pretty much doing the expected use case of using a Unity Web request to run this script and receive it's value.
The problem is it is most of the time, I am receiving an error that simply reads: "HTTP/1.1 406 Not Acceptable".
On the off-chance that this does succeed (which, i'm unable to tell why it acts differently), I get a massive wall of text which seems like a whole HTML script.
I would love any insight to this situation. Thank you!
P.s, when I open the URL or the php script in chrome, it performs perfectly.
Answer by WillowashWarlock · Apr 28, 2021 at 08:27 PM
I seemed to have found a solution. The issue was not with the unity side of things, but with my web server. My request was being blocked by Mod Security. I'm sure disabling this though my domain's cPanel has it's risks (which I will proceed to understand), and cannot safely recommend it.
However, I can now communicate with my php script through unity.