Beispiel #1
0
        // Start is called before the first frame update
        void Start()
        {
            Request req = new Request(GameApiScript.urlScene(), GameApiScript.bodyGetScene(), RequestType.GET);

            WebCallScript.instance.callUrl(req, (errNode, sucNode) => {
                if (errNode != null)
                {
                    Debug.Log(errNode);
                }
                else
                {
                    Debug.Log(sucNode);
                    instantiateButtons(sucNode["data"]["scenes"]);
                }
            });
        }
Beispiel #2
0
        public Request(string url, Dictionary <string, string> body, RequestType requestType, CallType callType = CallType.General, bool isAbsolute = false)
        {
            if (!isAbsolute)
            {
                this.url = GameApiScript.formAbsoluteURL(url);
            }
            else
            {
                this.url = url;
            }
            this.body = body;

            this.requestType = requestType;
            this.callType    = callType;

            isJsonType = false;
            refreshHeaders();
        }
Beispiel #3
0
        public Request(string url, JSONNode body, RequestType requestType, CallType callType = CallType.General, bool isAbsolute = false)
        {
            if (!isAbsolute)
            {
                this.url = GameApiScript.formAbsoluteURL(url);
            }
            else
            {
                this.url = url;
            }

            this.jsonBody = body;
            this.body     = null;

            this.requestType = requestType;
            this.callType    = callType;

            isJsonType = true;
            refreshHeaders();
        }