Previously (as recently as Unity 5.6), it was possible to add header data to a WWW GET request by passing null in as the postdata parameter like this:
string URL = “https://somewhere.com/LookupREST/2.0?foo=234asdfas090&countrycode=US”;
Dictionary<string, string> headerInfo = new Dictionary<string, string>();
headerInfo.Add(“Authorization”, “Basic AFDS90AFDS908FDS987F86HG876”);
WWW www = new WWW(URL, null, headerInfo);
yield return www;
Documentation says: “The WWW class can be used to send both GET and POST requests to the server. The WWW class will use GET by default and POST if you supply a postData parameter.”
This seems to have changed in the 2017 beta, and has broken the way we enforce GET to be used with headers. Is there any chance this will be switched back on the next beta build?
Is there another way to do this? I read that System.Web only works on Windows machines, we want a cross platform solution.
I have submitted an official bug report using the beta’s Help->Report a bug feature.
More info here: GET method with header in www class Unity - Unity Engine - Unity Discussions