public static string EscapeURL(string s, Encoding e)
        {
            bool   flag = s == null;
            string result;

            if (flag)
            {
                result = null;
            }
            else
            {
                bool flag2 = s == "";
                if (flag2)
                {
                    result = "";
                }
                else
                {
                    bool flag3 = e == null;
                    if (flag3)
                    {
                        result = null;
                    }
                    else
                    {
                        byte[] bytes  = e.GetBytes(s);
                        byte[] bytes2 = WWWTranscoder.URLEncode(bytes);
                        result = e.GetString(bytes2);
                    }
                }
            }
            return(result);
        }
Beispiel #2
0
        public static UnityWebRequest Post(string uri, string postData)
        {
            UnityWebRequest request = new UnityWebRequest(uri, "POST");
            string          s       = WWWTranscoder.URLEncode(postData, Encoding.UTF8);

            request.uploadHandler             = new UploadHandlerRaw(Encoding.UTF8.GetBytes(s));
            request.uploadHandler.contentType = "application/x-www-form-urlencoded";
            request.downloadHandler           = new DownloadHandlerBuffer();
            return(request);
        }
Beispiel #3
0
        public static UnityWebRequest Post(string uri, string postData)
        {
            UnityWebRequest unityWebRequest = new UnityWebRequest(uri, "POST");

            byte[] data = null;
            if (!string.IsNullOrEmpty(postData))
            {
                string s = WWWTranscoder.URLEncode(postData, Encoding.UTF8);
                data = Encoding.UTF8.GetBytes(s);
            }
            unityWebRequest.uploadHandler             = new UploadHandlerRaw(data);
            unityWebRequest.uploadHandler.contentType = "application/x-www-form-urlencoded";
            unityWebRequest.downloadHandler           = new DownloadHandlerBuffer();
            return(unityWebRequest);
        }
Beispiel #4
0
 public static string EscapeURL(string s, Encoding e)
 {
     if (s == null)
     {
         return(null);
     }
     if (s == string.Empty)
     {
         return(string.Empty);
     }
     if (e == null)
     {
         return(null);
     }
     return(WWWTranscoder.URLEncode(s, e));
 }
        public static string EscapeURL(string s, Encoding e)
        {
            if (s == null)
            {
                return(null);
            }

            if (s == "")
            {
                return("");
            }

            if (e == null)
            {
                return(null);
            }

            var bytes        = e.GetBytes(s);
            var decodedBytes = WWWTranscoder.URLEncode(bytes);

            return(e.GetString(decodedBytes));
        }
Beispiel #6
0
        public static string EscapeURL(string s, Encoding e)
        {
            string result;

            if (s == null)
            {
                result = null;
            }
            else if (s == "")
            {
                result = "";
            }
            else if (e == null)
            {
                result = null;
            }
            else
            {
                result = WWWTranscoder.URLEncode(s, e);
            }
            return(result);
        }
        public static string EscapeURL(string s, Encoding e)
        {
            string result;

            if (s == null)
            {
                result = null;
            }
            else if (s == "")
            {
                result = "";
            }
            else if (e == null)
            {
                result = null;
            }
            else
            {
                byte[] bytes  = Encoding.UTF8.GetBytes(s);
                byte[] bytes2 = WWWTranscoder.URLEncode(bytes);
                result = e.GetString(bytes2);
            }
            return(result);
        }