Unity post data to laravel issues

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.

If you expect your WWWForm to be sent as JSON, you are wrong. It sends HTML form. You need to manually serialize JSON.

Even without the www.SetRequestHeader("Content-Type", "application/json"); the request ends up being empty.

That was just my last ditch effort to get the request to go through

How are you reading the request? Are you reading the POST fields?
You may also try disabling HTTP-Continue on the request. Some servers have issues with that.

There were some server-side issues that got resolved with API changes (app/server that I am communicating with is not my project).
After that & with the removal of header content type the request works

Issue resolved