WWW Form upload with header not working

Hi,
I am trying to upload an image file from Unity where the webserver need authorisation header from authentication.

WWWForm  form = new WWWForm();
form.AddBinaryData("file", data, fileName, contentType);
WWW www = new WWW(url, form);

it works fine…
But problems comes up when I use something like this even without header…

byte[] rawData = form.data;
WWW www = new WWW(url, rawData);

and it doesn’t… I even added some header information like this is and doesn’t work either.

Hashtable headers = new Hashtable();
Dictionary<string, string> parameters = new Dictionary<string, string>();
string strHeader = "something";
headers["Authorization"] = strHeader;
byte[] rawData = form.data;
WWW www = new WWW(url, rawData, headers);

The WWW class doesn’t let you do many normal HTTP things. UniWeb provides complete support for HTTP. It should support everything you need.

Just came with the same issue.

Using AddBinaryData clears added headers :confused:

Seen with wireshark… with Unity 5.0.1f1 :confused:

We must use TCPClient or Uniweb (that uses TCPClient) or wait for Unity to fix this (will that ever happen?) ^^’