// 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"]); } }); }
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(); }
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(); }