|
@@ -31,7 +31,7 @@ public class SendingFormController : MonoBehaviour
|
|
|
|
|
|
}
|
|
|
|
|
|
- public static IEnumerator PostRequest(string controller, string api, Dictionary<string, string> data, Action<string, Dictionary<string, string>> callback = null, Action<WWW> errorCallback = null)
|
|
|
+ /*public static IEnumerator PostRequest(string controller, string api, Dictionary<string, string> data, Action<string, Dictionary<string, string>> callback = null, Action<WWW> errorCallback = null)
|
|
|
{
|
|
|
WWWForm form = new WWWForm();
|
|
|
//form.AddField("login", login);
|
|
@@ -71,7 +71,7 @@ public class SendingFormController : MonoBehaviour
|
|
|
//else
|
|
|
errorCallback(www);
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
|
|
|
IEnumerator PostRequest(string url, string json)
|
|
@@ -144,7 +144,10 @@ public class SendingFormController : MonoBehaviour
|
|
|
{
|
|
|
//Debug.Log(url);
|
|
|
//var img = UnityWebRequestTexture.GetTexture(url); //, null, headers);
|
|
|
-
|
|
|
+ img.SetRequestHeader("Access-Control-Allow-Credentials", "true");
|
|
|
+ img.SetRequestHeader("Access-Control-Allow-Headers", "Accept, X-Access-Token, X-Application-Name, X-Request-Sent-Time");
|
|
|
+ img.SetRequestHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
|
|
|
+ img.SetRequestHeader("Access-Control-Allow-Origin", "*");
|
|
|
yield return img.SendWebRequest();
|
|
|
if (img.isNetworkError || img.isHttpError)
|
|
|
{
|