Пример #1
0
        public ApiClient()
        {
            client          = new WebClient();
            client.Encoding = Encoding.UTF8;

            #region 埋apiKey在Header裡面
            string apiKey = string.Format("apiKey:{0}", GetAppKey.keyVal("apiKey"));
            client.Headers.Add(apiKey);
            #endregion

            nvc    = new NameValueCollection();
            buffer = null;
            result = string.Empty;
        }
Пример #2
0
        public string ApiPath(string ApiActionName = "")
        {
            string ApiDomain = GetAppKey.keyVal("apiDomain");

            return(string.Format("http://{0}/api/{1}", ApiDomain, ApiActionName));
        }