How to implement the new method UnityWebRequest here?
I tried it but on the line … … Debug.Log((System.Text.Encoding.UTF8.GetString(DataPost.bytes))); … it makes me wrong
IEnumerator EnviarNick(string nombreJugador)
{
string hash = Md5Sum(nombreJugador + claveSecreta);
string PostURL = URLVerNick + "players=" + WWW.EscapeURL(nombreJugador) + "&hash=" + hash;
WWW DataPost = new WWW("https://" + PostURL);
yield return DataPost;
if (DataPost.error != null)
{
print("Problema al intentat enviar jugador a la base de datos:-"+ DataPost.error);
}
else
//print("Datos enviados:-" + DataPost.error);
Debug.Log((System.Text.Encoding.UTF8.GetString(DataPost.bytes)));
}
Show the code with UnityWebRequest.
And the way you construct the URL look fishy to me, try printing out the URL before sending request and check if it is correct.
IEnumerator EnviarNickUnityWebRequest(string nombreJugador)
{
string hash = Md5Sum(nombreJugador + claveSecreta);
string PostURL = URLVerNick + "players=" + UnityWebRequest.EscapeURL(nombreJugador) + "&hash=" + hash;
UnityWebRequest DataPost = new UnityWebRequest("https://" + PostURL);
yield return DataPost;
if (DataPost.error != null)
{
print("Problema al intentat enviar jugador a la base de datos:-" + DataPost.error);
}
else
//print("Datos enviados:-" + DataPost.error);
Debug.Log((System.Text.Encoding.UTF8.GetString(DataPost.bytes))); // i have the problem here in bytes
}