Hello
I’m sending data to a server using WWW class in chunks. Chunked transfer encoding - Wikipedia
This works fine in Unity Standalone Windows/OSX but in iOS it the data just wont go through, meaning i send the WWW and i get no response from the server (tested with several web servers) .
What i do is to add necessary headers for using chunked encoding (Transfer-Encoding: chunked)
Dictionary<string, string> customHeaders = new Dictionary<string, string>();
customHeaders.Add("Transfer-Encoding", "chunked");
WWW www = new WWW(Url, chunk.m_data, customHeaders);
As i said it works on standalone, haven’s tested on Android or WindowsStore/Phone.
Unity is setting “Content-Length” automatically even when i use chunked transfer where that should not exist. It does that on both Windows and iOS although it works on Windows but not in iOS.
I’m running out of options here so i will try a plugin to handle http.
For someone chasing this same problem here is the solution.
Basically Unity is setting the “Content-Length” no matter what and that needed to be removed is case of a chunked transfer.