- Home /
www Get plus headers dictionary works fine on Android but not on iOS
I know this has been an issue, but there are no answers, especially since hashtables are depricated and we have to use dictionaries.
This is my code to fetch a JSon-String from a server. It works fine on Android, Mac etc, I can fetch the data from a php script, but iOS apparently does something differently, I only get a "400 Bad Request" error from the server.
IEnumerator WaitForRequest() {
Dictionary<string, string> dict_api = new Dictionary<string, string>();
string url_api = "https://api.quizlet.com/2.0/sets/mysetsid";
dict_api.Add("Authorization:", "Bearer mycodexyzf19f6611b11aea488d2e6aa08d762");
WWW download = new WWW (url_api, null, dict_api);
yield return download;
}
Is there any reason why this does not work on iOS and is there any possibility to make it work?
Answer by meg_gem · Nov 23, 2015 at 12:56 PM
We found the error in the end and as it might happen to somebody else: So much time spent on such a tiny problem:
In the key I use "Authorization:" with a colon. This works fine on every platform, except iOS. When I delete the colon and write "Authorization" instead, it works. What a crazy, time consuming error...
Your answer
![](https://koobas.hobune.stream/wayback/20220612044944im_/https://answers.unity.com/themes/thub/images/avi.jpg)