コード例 #1
0
        public static byte[] Post(string modelName, string method, User user, byte[] bytes, Dictionary <string, string> param = null)
        {
            var url = GetForwardUrl(modelName, method);

            if (param == null)
            {
                param = new Dictionary <string, string>();
            }
            if (bytes == null)
            {
                bytes = new byte[0];
            }
            var headers = Kooboo.Data.Service.TwoFactorService.GetHeaders(user.Id);

            if (param != null)
            {
                foreach (var p in param)
                {
                    if (!headers.ContainsKey(p.Key))
                    {
                        headers[p.Key] = p.Value;
                    }
                }
            }
            return(EmailHttpHelper.PostBytes(url, bytes, headers));
        }
コード例 #2
0
        public static T Post <T>(string modelName, string method, User user, Dictionary <string, string> param)
        {
            var url     = GetForwardUrl(modelName, method);
            var headers = TwoFactorUserCache.GetHeaders(user.Id);

            return(EmailHttpHelper.Post <T>(url, param, headers));
        }
コード例 #3
0
        public static T Get <T>(string modelName, string method, User user, Dictionary <string, string> param = null)
        {
            var url     = GetForwardUrl(modelName, method);
            var headers = Kooboo.Data.Service.TwoFactorService.GetHeaders(user);

            return(EmailHttpHelper.Get <T>(url, param, headers));
        }
コード例 #4
0
        public static T Post <T>(string modelName, string method, User user, byte[] bytes, Dictionary <string, string> param = null)
        {
            var url     = GetForwardUrl(modelName, method);
            var headers = TwoFactorUserCache.GetHeaders(user.Id);

            if (param != null)
            {
                foreach (var p in param)
                {
                    if (!headers.ContainsKey(p.Key))
                    {
                        headers[p.Key] = p.Value;
                    }
                }
            }

            return(EmailHttpHelper.Post <T>(url, headers, bytes));
        }