Hi
I’m trinyg to post data from my unity app to php/laravel.
I have tested the api in postman and it returns 200/OK but when I send the request in unity I keep getting 500 error.
The request on the server shows up as empty, without any body data.
WWWForm form = new WWWForm();
form.AddField("token", tokenvalue);
form.AddField("email", email);
form.AddField("lat",latitude );
form.AddField("long", longitude );
form.AddField("startTime", "2011-11-11 11:11:11");
form.AddField("currentTime", currentTime);
form.AddField("fullName", fullName);
UnityWebRequest www = UnityWebRequest.Post(url , form);
Debug.Log(www);
www.SetRequestHeader("Content-Type", "application/json");
www.SetRequestHeader("Authorization", "Bearer XlOorHn8dMthtbdpGE6yaf7wx0q7rfzZ7L4x6tduP5oYO4gSrr7lhpmj5RBW");
yield return www.SendWebRequest();
I am catching the response and have code that does other things based if it’s ‘OK’.
All of the values in the fields are string variables as expected.