I am trying to make a Post request using the UnityWebRequest class. Everything works well if I use this:
IEnumerator Loginplayer_old()
{
print("Login");
WWWForm form = new WWWForm();
form.AddField("name", Login_Field_name.text);
form.AddField("password", Login_Field_Password.text);
WWW www = new WWW("http://localhost/sqlconnect/register.php", form);
yield return www;
}
But if I use the Post function like this it doesn't work at all:
IEnumerator Loginplayer_old()
{
print("Login");
WWWForm form = new WWWForm();
form.AddField("name", Login_Field_name.text);
form.AddField("password", Login_Field_Password.text);
UnityWebRequest www = UnityWebRequest.Post("http://localhost/sqlconnect/register.php", form);
yield return www;
}
What should I do to get this working?