Example #1
0
        /// <summary>
        /// 获取 access token
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public static Gitee_AccessToken_ResultEntity AccessToken(Gitee_AccessToken_RequestEntity entity)
        {
            if (!LoginBase.IsValid(entity))
            {
                return(null);
            }

            string pars = LoginBase.EntityToPars(entity);

            var result = Core.HttpTo.Post(GiteeConfig.API_AccessToken, pars);

            var outmo = LoginBase.ResultOutput <Gitee_AccessToken_ResultEntity>(result);

            return(outmo);
        }
Example #2
0
        /// <summary>
        /// 获取 access token
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public static Gitee_AccessToken_ResultEntity AccessToken(Gitee_AccessToken_RequestEntity entity)
        {
            if (!LoginBase.IsValid(entity))
            {
                return(null);
            }

            string pars = LoginBase.EntityToPars(entity);

            var hwr = LoginBase.HttpTo.HWRequest(GiteeConfig.API_AccessToken, "POST", pars);

            hwr.Accept = "application/json";//application/xml
            string result = LoginBase.HttpTo.Url(hwr);

            var outmo = LoginBase.ResultOutput <Gitee_AccessToken_ResultEntity>(result);

            return(outmo);
        }