Hello! Guys, were there any changes in WWW or WWWForm? Because after update to 2017.3 POST requests (www to url with WWWForm) broken (empty form data received on server, or, maybe, incorrect headers).
Can you show the code sample on how you use WWW?
I think there were fixes related to how we encode the form and we were fixing chunked transfer support in UnityWebRequest which accidentaly went to WWW too (we’re reverting that in latest fixes).
Have you tried using tools like Fiddler to monitor traffic, see what data is being sent?
Hi! Ofcourse i’m using fiddler for check request data The form leaves, but I suspect that the problem, as you said, with the encoding, because on the server side (python with a flask) the request is not parsed (and return empty array), on the previous version (2017.2.0f3) everything works and flask can parse form. Code sample is very simple:
public WWW POST(string url, Dictionary<string, string> post)
{
WWWForm form = new WWWForm();
foreach(KeyValuePair<string, string> post_arg in post)
{
form.AddField(post_arg.Key, post_arg.Value);
}
WWW www = new WWW(url, form);
StartCoroutine(WaitForRequest(www, “Synchronization…”));
return www;
}
Tomorrow I will make 2 identical requests from two different versions of the engine, and compare them, then I’ll say more in detail
Hello,
I am experiencing a similar issue with WWW and post request.
You use Google App Engine and Python on server side?
I am using Apache server with php (slim as framework)
I am having the same issue. My python server thinks the form data is empty.
This probably isn’t relevant but it sounds vaguely familiar ( UnityWebRequest.Post sends strings with escaped characters - #12 by kaskiU ) - might also be worth trying patch builds if you haven’t already.
Thanks @tonemcbride , but I don’t think it’s an escape sequence issue. My form.AddField() keys and values are plain text with no special characters. They just aren’t being sent.
Not certainly in that way. The form leaves correctly, not empty and the data in it is. However, the flask module in GAE does not work correctly. On clean node.js, python, .net and others, the form is parsed normally and correctly. In flask, the parser drops and returns an empty array.
+1 WWWForms are completely broken in 2017.3. Everything was fine in 2017.2, then I updated to latest, and it’s broke. The server reports the form post data is empty. EG in php $_POST[ ] contains nothing at all.
All my client and server code hasn’t changed…only my Unity version, now I’m left with a dead project and have to roll back my unity version. Merry Christmas from Unity
I’ve just rolled back to 2017.2 and my forms are working perfectly again.
I’ve submitted a bug report, haven’t had a ticket id response yet tho.
We also got problems with it.
It seems that Unity 2017.3 WWW uses header of “Transfer-Encoding: chunked” instead of “Content-Length”.
Yes, that’s it, they changed it. In view of that, many platforms and libraries (flask, GAE) do not understand the stream.
+1… I am SO glad I found this thread. I thought I was losing my mind. I am a fairly new Unity developer, so I thought it was me. Has anyone tried 2017.3 beta 4 to see if that helps?
Thank god, I thought there was something broken with my database
Estou com o mesmo problema. Tive que regressar para versão 2017.2. Agora está funcionando! WWWForm está totalmente quebrado na 2017.3
Same problem here. Should have googled this BEFORE I spent 3 hours looking into my server code - everything related to WWWform stopped working with 2017.3. Dear Unity - when is fix coming?
I’m answered before - this is not Unity bug, this problem - many old systems don’t understand chunk streaming. Clear node.js works fine with chunks and unity 2017.3 WWWForm.
I found straightforward solution. Use wwwform as before, but as follows:
UnityWebRequest www = UnityWebRequest.Post(URL, wwwform);
www.chunkedTransfer = false;
yield return www.SendWebRequest();
string returntext = www.downloadHandler.text;
byte[ ] returndata = www.downloadHandler.data;
This enables using code that relies heavily on wwwform, as mine does. I use it to access mysql via php server. The money line is www.chunkedTransfer = false which makes request fall back to older compatible header.