Quantcast
Channel: Questions in topic: "webgl"
Viewing all articles
Browse latest Browse all 2390

Adding Custom Headers/Cookies to the UnityWebRequest.Post

$
0
0
Dear developers, I have problems about adding custom headers to my web requests. I would be appreciated if you help me. UnityWebRequest www = UnityWebRequest.Post(Url, form); www.SetRequestHeader("cookie", "sid=" + SessionManager.Instance.User.Sid); www.SetRequestHeader("cookie", "proxyAddress=" + SessionManager.Instance.User.ProxyAdress); www.SetRequestHeader("cookie", "ruleVersion=" + SessionManager.Instance.User.RuleVersion); www.SetRequestHeader("cookie", "downloadManagerAddress=" + SessionManager.Instance.User.DownloadManagerAdress); If I use the "cookie" as request header name it gives that error : Refused to set unsafe header "cookie" UnityWebRequest www = UnityWebRequest.Post(Url, form); www.SetRequestHeader("Cookie", "sid=" + SessionManager.Instance.User.Sid); www.SetRequestHeader("Cookie", "proxyAddress=" + SessionManager.Instance.User.ProxyAdress); www.SetRequestHeader("Cookie", "ruleVersion=" + SessionManager.Instance.User.RuleVersion); www.SetRequestHeader("Cookie", "downloadManagerAddress=" + SessionManager.Instance.User.DownloadManagerAdress); If I use "Cookie" as a request header name it gives that error: InvalidOperationException: Cannot override system-specified headers I'm trying to build for WebGL.I in the scriptingAPI Unity says UnityWebRequest class is supported at WebGL. Dear develepoers pls help me about that. Is it not available adding custom headers to the UnityWebRequest. If so, I need to change my backend services so need to know. It is boring if it does not support adding custom headers waste of time.

Viewing all articles
Browse latest Browse all 2390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>