/// <summary>
        /// 发送HttpGet请求(Lua层使用)
        /// </summary>
        /// <param name="url"></param>
        /// <param name="header"></param>
        /// <param name="args"></param>
        /// <param name="callback"></param>
        public void GetHttpRequest(string url, LuaTable header, LuaTable args, Action <byte[]> callback)
        {
            var headerKeys = header.GetKeys();
            var e          = headerKeys.GetEnumerator();

            HttpHeads.Clear();
            while (e.MoveNext())
            {
                var key   = e.Current.ToString();
                var value = header.Get <string>(key);
                HttpHeads.Add(key, value);
            }

            var argKeys = args.GetKeys();
            var e2      = argKeys.GetEnumerator();

            HttpArgs.Clear();
            while (e2.MoveNext())
            {
                var key   = e2.Current.ToString();
                var value = args.Get <string>(key);
                HttpArgs.Add(key, value);
            }
            HttpAgent.Get(url, HttpArgs, HttpHeads, callback);
        }
        /// <summary>
        /// 发送HttpPost请求(Lua层使用)
        /// </summary>
        /// <param name="url"></param>
        /// <param name="header"></param>
        /// <param name="postData"></param>
        /// <param name="callback"></param>
        public void PostHttpRequest(string url, LuaTable header, byte[] postData, Action <byte[]> callback)
        {
            var headerKeys = header.GetKeys();
            var e          = headerKeys.GetEnumerator();

            HttpHeads.Clear();
            while (e.MoveNext())
            {
                var key   = e.Current.ToString();
                var value = header.Get <string>(key);
                HttpHeads.Add(key, value);
            }
            HttpAgent.Post(url, postData, HttpHeads, callback);
        }
 public override void Init()
 {
     HttpAgent = new HttpAgent();
 }
 /// <summary>
 /// 发送HttpGet请求(CS层使用)
 /// </summary>
 /// <param name="url"></param>
 /// <param name="header"></param>
 /// <param name="args"></param>
 /// <param name="callback"></param>
 public void GetHttpRequest(string url, Dictionary <string, string> header, Dictionary <string, string> args, Action <byte[]> callback)
 {
     HttpAgent.Get(url, args, header, callback);
 }
 /// <summary>
 /// 发送HttpPost请求(CS层使用)
 /// </summary>
 /// <param name="url"></param>
 /// <param name="header"></param>
 /// <param name="postData"></param>
 /// <param name="callback"></param>
 public void PostHttpRequest(string url, Dictionary <string, string> header, byte[] postData, Action <byte[]> callback)
 {
     HttpAgent.Post(url, postData, header, callback);
 }