- string authenticate(string username, string password)
- {
- string auth = username + ":" + password;
- auth = System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(auth));
- auth = "Basic " + auth;
- return auth;
- }
- IEnumerator xxxxx(string url)
- {
- string authorization = authenticate("xxx", "xxx");
-
- while (true)
- {
- UnityWebRequest unityWebRequest = new UnityWebRequest(url);
-
- unityWebRequest.SetRequestHeader("AUTHORIZATION", authorization);
-
- yield return unityWebRequest.SendWebRequest();
-
- .....
- }
-
-
- }