- Home /
Error when creating http request. GET request with custom headers is not supported.
Hi,
I'm trying to use Twitter API and there are some situations where I need to perform http "GET" operation with custom headers but when I do it with WWW class, it returns the error message.
You are trying to load data from a www stream which had the following error when downloading. Error when creating request. GET request with custom headers is not supported.
Does anyone know why WWW doesn't support custom headers for GET request? Could Unity please fix this problem?
Thanks in advance!
The procedure is to write the answer and mark it solved, rather than writing "solved" in the title.
@Eric5h5, thx~ btw I've realized that I still need some helps on this question so I've edited it again.
Does this relate at all to my question? http://answers.unity3d.com/questions/613777/web-player-crashes-during-www-request-to-server.html
Answer by Simon Wittber · Jan 31, 2011 at 06:50 AM
It is simply not supported. This might help you, however. A WWW Alternative
thanks! I will try to use the alternative. I hope Unity will support this in a near future.
Answer by ina · Jan 05, 2014 at 01:35 AM
Unity 4.3 (just checked) now supports custom headers using GET
WWW w = new WWW(url,null,headers);
where headers
is a hashtable of headers
really? That would be great ;) Unity had a lot strange (in)sanity-checks which i never understood why they're doing those checks.
I have a project in Unity 4.3, and using WWW 2 = new WWW(url,null,headers);
to create a GET request with custom headers works when playing the game in the Editor, but NOT in the webplayer build. In the webplayer build shows the following error:
Error when creating request. GET request with custom headers is not supported.
Same problem here as pedro with 4.6, it works in the editor, using either Hashtable or Dictionary for the headers, however in the webplayer it fails throwing the error:
Error when creating request. GET request with custom headers is not supported
Answer by MRCalderon3D · Jan 07, 2014 at 10:59 AM
In 4.3, WWW constructor for WP8 or Windows Store doesn't support Hastables.
Your answer
Follow this Question
Related Questions
HTTP Response Headers? 3 Answers
POST data via WWWForm is not working for Twitter OAuth process. 1 Answer
get twitter access token 1 Answer
WWW Resolving host timed out 2 Answers
http request over an https webgl 1 Answer