Good evening everyone,
Not sure if I’m in the right forum but I could use some help.
For a Demo I need to change a value on the server with a post method.
The finished url should look like “http://…/urlLightState?value=true” for example. (so the value defines if the light is on or off in this case it should turn on the light)
This is what my code looks like:
…
request = GameObject.FindGameObjectWithTag(“Settings”).GetComponent().UrlLightState;
…
form.AddField(“state”, “” + _lichtState);
…
UnityWebRequest www = UnityWebRequest.Post(request, form);
yield return www.Send();
while ()
{
Debug.LogError(“.”);
yield return null;
}
if (www.isNetworkError)
{
Debug.Log(www.error);
}
else
{
Debug.Log(www.downloadHandler.text);
string temp = www.downloadHandler.text;
Debug.Log(temp);
}