I already asked on answers.unity3d but as there is no response I'll ask on SO too..
I'm not able to retrieve the http status of a response on the WWW object on Windows Phone 8 and Windows RT 8.1 (while it's ok on IOS/Android).
www.responseHeader["STATUS"]
does not exists and the hidden field _responseHeaderString
does not contain as first line
HTTP/1.1 200 OK
responseHeaderString :
Server: nginx
Date: Wed, 21 Oct 2015 07:44:36 GMT
Last-Modified: Mon, 07 Sep 2015 11:43:46 GMT
Connection: keep-alive
Expires: Fri, 20 Nov 2015 07:44:36 GMT
Cache-Control: max-age=2592000
Cache-Control: public
responseHeader :
{
"SERVER" : "nginx"
"DATE" : "Wed, 21 Oct 2015 07:44:36 GMT"
"LAST-MODIFIED": "Mon, 07 Sep 2015 11:43:46 GMT"
"CONNECTION" : "keep-alive"
"EXPIRES" : "Fri, 20 Nov 2015 07:44:36 GMT"
"CACHE-CONTROL": "public"
}
Sample code to reproduce : (tested on an empty new project)
WWW www = new WWW("http://www.google.com");
yield return www;
Debug.Log("Google Status : " + www.responseHeaders.ContainsKey("STATUS")); // False
Debug.Log(www.text); // <doctype ...
Debug.Log(www.responseHeaders["STATUS"]); // KeyError
Am I missing something or is there someone that can confirm this as a bug ?
Edit: Still not able to retrieve the http status with the latest 5.3
file://
or other protocol? The header would suggest HTTP, but these things tend to get emulated in some environments, and I did have this behavior before when using afile://
protocol on android. – Bellbirdhttp
request to download a file, so I need 304/200 information :) – Beastwww.error
isnull
. – BeastSTATUS
is still missing :/ – Beast