PUT Request Failing.
HI all,
I am using a PUT REST Service that, if I use from postman, works fine. The code is here:
string url = myURL;
string data= @"{""user"":""nacho""}";
byte[] body = Encoding.UTF8.GetBytes(cadena);
UnityWebRequest www = UnityWebRequest.Put(url, body);
yield return www.Send();
if (www.isError)
{
Debug.Log(www.error);
}
else
{
Debug.Log(www.downloadHandler.text);
}
But i allways receive a error message:
<head><title>Not Acceptable!</title></head><body><h1>Not Acceptable!</h1><p>An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.</p></body></html>
UnityEngine.Debug:Log(Object)
<updateUserName>c__IteratorA:MoveNext() (at Assets/Scripts/Data/DatabaseManager.cs:95)
I have tried different ways to call it, but I always get the same error... The Server is working, becaus if I use the same values from postman, it works. so... ¿anyone could help?
Thank you in advance.
Comment
Your answer
Follow this Question
Related Questions
Pasting data from JSON into UI 0 Answers
UnityWebRequest read body response 0 Answers
REST Api SSE in Unity3D 1 Answer
How to handle UnityWebRequest Errors when throws Curl 28 Error 1 Answer
How to create a rest authentication header in unity 1 Answer