- Home /
Question by
Softnauts · Jan 08, 2018 at 08:55 AM ·
ioshttpauthenticationhttpwebrequest
IOS HTTP GET with Authorization Header not being sent
Hi! I have got a problem connected to sending HTTP GET request with authorization header on iOS platform. In the editor and on Android it's fully working, but on iOS it is working nondeterministically. With POST there is no problem with sending header. I would really appreciate your feedback on this. Below I am attaching code for creating request:
var www = UnityWebRequest.Get(url);
www.timeout = timeout;
foreach (var headerData in header)
{
www.SetRequestHeader(headerData.Key, headerData.Value);
}
and for creating request header:
public Dictionary<string, string> GetAuthorizationToken()
{
return new Dictionary<string, string>
{
{"Authorization", "Bearer " + _userDataManager.UserData.AuthorizationToken}
};
}
Comment