I successfully coded my game to register a player with their 'username, password, email' After Registering id like a player to fill in their username & password and have it checked by the db. Upon 'Login' i ran into this :
"ArgumentException: Cannot create a multipart form data section without body data"
public class NetworkManager : MonoBehaviour { public void SignupComplete() { // Make sure nothing is blank if (usernameSignup.text == "" || passwordSignup.text == "" || passwordVerification.text == "" || age.text == "" || email.text == "") { return; } // Check if passwords match if (passwordSignup.text != passwordVerification.text) { return; } // Check Age if (int.Parse(age.text)< 13) { return; } // IF the client makes it this far, send their data to the website! Debug.Log("Processing Request"); StartCoroutine(ProcessRequest(usernameSignup.text, passwordSignup.text, DATA_URL_SIGNUP, age.text, email.text)); } // ERROR WHEN LOGIN "ArgumentException: Cannot create a multipart form data section without body data" public void LoginComplete() { if(usernameLogin.text == "" || passwordLogin.text == "" ) { return; Debug.Log("Please fill in all fields!"); } StartCoroutine(ProcessRequest(usernameLogin.text, passwordLogin.text, DATA_URL_LOGIN)); Debug.Log("Processing Request"); } IEnumerator ProcessRequest(string username, string password, string url, string age = null, string email = null) { List<IMultipartFormSection> form = new List<IMultipartFormSection>(); form.Add(new MultipartFormDataSection("username", username)); form.Add(new MultipartFormDataSection("password", password)); form.Add(new MultipartFormDataSection("age", age != null ? age : "0")); //age != null ? age : "0" form.Add(new MultipartFormDataSection("email", email == null ? "" : email)); UnityWebRequest www = UnityWebRequest.Post(url, form); yield return www.SendWebRequest(); if (www.result != UnityWebRequest.Result.Success) { Debug.Log(www.error); } else { Debug.Log("Signup completed!"); } }