I’ve been going through the documentation for submitting a form via UnityWebRequest.Post, and seemingly no matter what method I use, the values always run in empty on the server.
Here is my IEnumerator that submits the web request
IEnumerator Upload()
{
WWWForm form = new WWWForm();
form.AddField("action", "create-user");
//url is filled in on my end, replacing with "--------" here
UnityWebRequest www = UnityWebRequest.Post("--------", form);
yield return www.SendWebRequest();
if (www.isNetworkError || www.isHttpError)
{
Debug.Log(www.error);
}
else
{
Debug.Log(www.downloadHandler.text);
}
}
It’s basically just a carbon copy of every example of this I see, yet I cannot get _POST or any variable of it to return anything. I did a var_dump of _POST on the server and it returns an empty array. Is there a server setting or something of the sort that I’m missing?
I’ve also tried using the IMultipartFormData and it does the same thing.
It’s also worth noting I have used GET and it works just fine, but I need the data to be sent through POST.