Exemplo n.º 1
0
        private new IEnumerator Send()
        {
            using (var req = UnityWebRequest.Delete(_uri)) {
                HttpTools.setHeaders(req, _headers);
                yield return(req.SendWebRequest());

                base.data = new ResponseData(
                    (!req.isNetworkError || !req.isHttpError)
                    , req.responseCode
                    , req.downloadHandler.text
                    );

                base.isDone = true;
            }
        }
Exemplo n.º 2
0
        private new IEnumerator Send()
        {
            using (var req = UnityWebRequest.Post(_uri, "")) {
                var data = new UploadHandlerRaw(Encoding.UTF8.GetBytes(_data));
                data.contentType = "application/json";

                req.uploadHandler = data;

                HttpTools.setHeaders(req, _headers);
                yield return(req.SendWebRequest());

                base.data = new ResponseData(
                    (!req.isNetworkError || !req.isHttpError)
                    , req.responseCode
                    , req.downloadHandler.text
                    );

                base.isDone = true;
            }
        }